From: Matthew Wilcox Date: Wed, 15 Dec 2010 20:44:03 +0000 (-0500) Subject: USB: uas: Use kzalloc instead of kmalloc X-Git-Tag: 2.1b_release~5936^2~11^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ac563cfd528033ee6e3bb4801b5c73468d0145c8;p=platform%2Fkernel%2Fkernel-mfld-blackbay.git 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 Signed-off-by: Matthew Wilcox Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/storage/uas.c b/drivers/usb/storage/uas.c index 3c7a244..721fe37 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, if (!urb) goto out; - iu = kmalloc(sizeof(*iu), gfp); + iu = kzalloc(sizeof(*iu), gfp); if (!iu) goto free; @@ -328,7 +328,7 @@ static struct urb *uas_alloc_cmd_urb(struct uas_dev_info *devinfo, gfp_t gfp, if (len < 0) len = 0; len = ALIGN(len, 4); - iu = kmalloc(sizeof(*iu) + len, gfp); + iu = kzalloc(sizeof(*iu) + len, gfp); if (!iu) goto free;