diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-03 19:25:32 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-03 19:25:32 +0000 |
commit | e8d3ef9fa6e1265bce5992d8f77414220b39d2d9 (patch) | |
tree | 09bf132380f6d9b925db951e6521776afea25d83 /drivers/firewire/nosy.c | |
parent | Releasing progress-linux version 5.10.216-1progress6u1. (diff) | |
download | linux-e8d3ef9fa6e1265bce5992d8f77414220b39d2d9.tar.xz linux-e8d3ef9fa6e1265bce5992d8f77414220b39d2d9.zip |
Merging upstream version 5.10.218.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'drivers/firewire/nosy.c')
-rw-r--r-- | drivers/firewire/nosy.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/firewire/nosy.c b/drivers/firewire/nosy.c index 88ed971e3..42d9f25ef 100644 --- a/drivers/firewire/nosy.c +++ b/drivers/firewire/nosy.c @@ -148,10 +148,12 @@ packet_buffer_get(struct client *client, char __user *data, size_t user_length) if (atomic_read(&buffer->size) == 0) return -ENODEV; - /* FIXME: Check length <= user_length. */ + length = buffer->head->length; + + if (length > user_length) + return 0; end = buffer->data + buffer->capacity; - length = buffer->head->length; if (&buffer->head->data[length] < end) { if (copy_to_user(data, buffer->head->data, length)) |