summaryrefslogtreecommitdiffstats
path: root/drivers/firewire/nosy.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-03 19:25:32 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-03 19:25:32 +0000
commite8d3ef9fa6e1265bce5992d8f77414220b39d2d9 (patch)
tree09bf132380f6d9b925db951e6521776afea25d83 /drivers/firewire/nosy.c
parentReleasing progress-linux version 5.10.216-1progress6u1. (diff)
downloadlinux-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.c6
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))