Skip to contentSkip to conversation

UAS: Use kzalloc instead of kmalloc

PATCH Luben Tuikov 1 participant 1 message Dec 10, 2010 SCSI

lore
Share & tools
lore
#0 lore raw

Patch retracted for this still-born driver. Instead please use superior uasp.c which was recently submitted.

Quoted 59 lines · Luben Tuikov

From: Luben Tuikov <[email protected]>
Subject: [PATCH] [USB] UAS: Use kzalloc instead of kmalloc
To: "Greg KH" <[email protected]>, [email protected], [email protected], [email protected], [email protected]
Date: Wednesday, October 27, 2010, 1:22 PM
"Be conservative in what you send,
liberal in what
you accept." -- In the spirit of this adage, don't
send Command IUs with randomly filled in data in
the reserved fields. (Yes, this shows up on the
wire.)

---
 drivers/usb/storage/uas.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/usb/storage/uas.c +1 -1
index 2054b1e..17e1820 100644
@@ -294,7 +294,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;

drivers/usb/storage/uas.c +2 -2
@@ -325,7 +325,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;
@@ -660,7 +660,7 @@ static int uas_probe(struct
 usb_interface *intf, const struct usb_device_id *id)
            
 return -ENODEV;
     }
 
-    devinfo = kmalloc(sizeof(struct
 uas_dev_info), GFP_KERNEL);
+    devinfo = kzalloc(sizeof(struct

uas_dev_info), GFP_KERNEL);
    if (!devinfo)
        return -ENOMEM;

Signature · 1 line
1.7.0.1