All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luben Tuikov <ltuikov-/E1597aS9LQAvxtiuMwx3w@public.gmane.org>
To: Greg KH <greg-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>,
	linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-scsi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	willy-VuQAYsv1563Yd54FQh9/CA@public.gmane.org
Subject: [PATCH] [USB] UAS: Use kzalloc instead of kmalloc
Date: Wed, 27 Oct 2010 13:22:22 -0700 (PDT)	[thread overview]
Message-ID: <628096.54960.qm@web31807.mail.mud.yahoo.com> (raw)

"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.)

Signed-off-by: Luben Tuikov <ltuikov-/E1597aS9LQAvxtiuMwx3w@public.gmane.org>
---
 drivers/usb/storage/uas.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/storage/uas.c b/drivers/usb/storage/uas.c
index 2054b1e..17e1820 100644
--- a/drivers/usb/storage/uas.c
+++ b/drivers/usb/storage/uas.c
@@ -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;
 
@@ -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;
 
-- 
1.7.0.1

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: Luben Tuikov <ltuikov@yahoo.com>
To: Greg KH <greg@kroah.com>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-scsi@vger.kernel.org, willy@linux.intel.com
Subject: [PATCH] [USB] UAS: Use kzalloc instead of kmalloc
Date: Wed, 27 Oct 2010 13:22:22 -0700 (PDT)	[thread overview]
Message-ID: <628096.54960.qm@web31807.mail.mud.yahoo.com> (raw)

"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.)

Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
---
 drivers/usb/storage/uas.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/storage/uas.c b/drivers/usb/storage/uas.c
index 2054b1e..17e1820 100644
--- a/drivers/usb/storage/uas.c
+++ b/drivers/usb/storage/uas.c
@@ -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;
 
@@ -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;
 
-- 
1.7.0.1


             reply	other threads:[~2010-10-27 20:22 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-27 20:22 Luben Tuikov [this message]
2010-10-27 20:22 ` [PATCH] [USB] UAS: Use kzalloc instead of kmalloc Luben Tuikov
2010-11-08 11:21 ` Matthew Wilcox
2010-11-08 15:55   ` Greg KH
2010-11-08 16:59   ` Luben Tuikov
2010-11-08 16:59     ` Luben Tuikov
  -- strict thread matches above, loose matches on Subject: below --
2010-11-08 17:50 Luben Tuikov
2010-11-08 17:50 ` Luben Tuikov
2010-11-08 18:46 Luben Tuikov
2010-11-08 18:46 ` Luben Tuikov
2010-12-10 10:49 Luben Tuikov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=628096.54960.qm@web31807.mail.mud.yahoo.com \
    --to=ltuikov-/e1597as9lqavxtiumwx3w@public.gmane.org \
    --cc=greg-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-scsi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=willy-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.