aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/firewire/core-cdev.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/firewire/core-cdev.c b/drivers/firewire/core-cdev.c
index d8ac0ce2d6bf..f7559bfeaba3 100644
--- a/drivers/firewire/core-cdev.c
+++ b/drivers/firewire/core-cdev.c
@@ -563,6 +563,10 @@ static int init_request(struct client *client,
563 (request->length > 4096 || request->length > 512 << speed)) 563 (request->length > 4096 || request->length > 512 << speed))
564 return -EIO; 564 return -EIO;
565 565
566 if (request->tcode == TCODE_WRITE_QUADLET_REQUEST &&
567 request->length < 4)
568 return -EINVAL;
569
566 e = kmalloc(sizeof(*e) + request->length, GFP_KERNEL); 570 e = kmalloc(sizeof(*e) + request->length, GFP_KERNEL);
567 if (e == NULL) 571 if (e == NULL)
568 return -ENOMEM; 572 return -ENOMEM;