aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wilcox <matthew@wil.cx>2010-12-15 15:44:03 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2010-12-15 18:26:44 -0500
commitac563cfd528033ee6e3bb4801b5c73468d0145c8 (patch)
treeb9643166fb82ae2ac3afa89c12526ff5bcfc94ac
parent4400ef311e10666a2e5acf97d040df89cb880cb2 (diff)
USB: uas: Use kzalloc instead of kmalloc
The IUs are not being fully initialised by the driver (due to the reserved space). Since we should be zeroing reserved fields, use kzalloc to do it for us. Reported-by: Luben Tuikov <ltuikov@yahoo.com> Signed-off-by: Matthew Wilcox <willy@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/usb/storage/uas.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/usb/storage/uas.c b/drivers/usb/storage/uas.c
index 3c7a24433784..721fe376be18 100644
--- a/drivers/usb/storage/uas.c
+++ b/drivers/usb/storage/uas.c
@@ -297,7 +297,7 @@ static struct urb *uas_alloc_sense_urb(struct uas_dev_info *devinfo, gfp_t gfp,
297 if (!urb) 297 if (!urb)
298 goto out; 298 goto out;
299 299
300 iu = kmalloc(sizeof(*iu), gfp); 300 iu = kzalloc(sizeof(*iu), gfp);
301 if (!iu) 301 if (!iu)
302 goto free; 302 goto free;
303 303
@@ -328,7 +328,7 @@ static struct urb *uas_alloc_cmd_urb(struct uas_dev_info *devinfo, gfp_t gfp,
328 if (len < 0) 328 if (len < 0)
329 len = 0; 329 len = 0;
330 len = ALIGN(len, 4); 330 len = ALIGN(len, 4);
331 iu = kmalloc(sizeof(*iu) + len, gfp); 331 iu = kzalloc(sizeof(*iu) + len, gfp);
332 if (!iu) 332 if (!iu)
333 goto free; 333 goto free;
334 334