aboutsummaryrefslogtreecommitdiffstats
path: root/usb
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2006-02-20 21:32:57 -0800
committerGreg Kroah-Hartman <gregkh@suse.de>2006-02-20 21:32:57 -0800
commitf7548a8c177dd826a964700f1d93e99330f2652e (patch)
tree27913e9a8fb9a9c24d0cdf68911b472f20001d34 /usb
parente3833654a2d7a762130e15d17844104be13b302f (diff)
downloadpatches-f7548a8c177dd826a964700f1d93e99330f2652e.tar.gz
relayfs to sysfs patches
Diffstat (limited to 'usb')
-rw-r--r--usb/ub-use-kzalloc.patch63
1 files changed, 63 insertions, 0 deletions
diff --git a/usb/ub-use-kzalloc.patch b/usb/ub-use-kzalloc.patch
new file mode 100644
index 0000000000000..52091cbb74b54
--- /dev/null
+++ b/usb/ub-use-kzalloc.patch
@@ -0,0 +1,63 @@
+From zaitcev@redhat.com Mon Feb 13 20:36:09 2006
+Date: Mon, 13 Feb 2006 20:35:57 -0800
+From: Pete Zaitcev <zaitcev@redhat.com>
+To: Greg KH <greg@kroah.com>
+Cc: zaitcev@redhat.com
+Subject: ub: use kzalloc
+Message-Id: <20060213203557.4892cf5a.zaitcev@redhat.com>
+
+Switch from kmalloc+memset to kzalloc.
+
+Signed-off-by: Pete Zaitcev <zaitcev@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/block/ub.c | 12 ++++--------
+ 1 file changed, 4 insertions(+), 8 deletions(-)
+
+--- gregkh-2.6.orig/drivers/block/ub.c
++++ gregkh-2.6/drivers/block/ub.c
+@@ -2007,9 +2007,8 @@ static int ub_sync_tur(struct ub_dev *sc
+ init_completion(&compl);
+
+ rc = -ENOMEM;
+- if ((cmd = kmalloc(ALLOC_SIZE, GFP_KERNEL)) == NULL)
++ if ((cmd = kzalloc(ALLOC_SIZE, GFP_KERNEL)) == NULL)
+ goto err_alloc;
+- memset(cmd, 0, ALLOC_SIZE);
+
+ cmd->cdb[0] = TEST_UNIT_READY;
+ cmd->cdb_len = 6;
+@@ -2062,9 +2061,8 @@ static int ub_sync_read_cap(struct ub_de
+ init_completion(&compl);
+
+ rc = -ENOMEM;
+- if ((cmd = kmalloc(ALLOC_SIZE, GFP_KERNEL)) == NULL)
++ if ((cmd = kzalloc(ALLOC_SIZE, GFP_KERNEL)) == NULL)
+ goto err_alloc;
+- memset(cmd, 0, ALLOC_SIZE);
+ p = (char *)cmd + sizeof(struct ub_scsi_cmd);
+
+ cmd->cdb[0] = 0x25;
+@@ -2405,9 +2403,8 @@ static int ub_probe(struct usb_interface
+ return -ENXIO;
+
+ rc = -ENOMEM;
+- if ((sc = kmalloc(sizeof(struct ub_dev), GFP_KERNEL)) == NULL)
++ if ((sc = kzalloc(sizeof(struct ub_dev), GFP_KERNEL)) == NULL)
+ goto err_core;
+- memset(sc, 0, sizeof(struct ub_dev));
+ sc->lock = ub_next_lock();
+ INIT_LIST_HEAD(&sc->luns);
+ usb_init_urb(&sc->work_urb);
+@@ -2524,9 +2521,8 @@ static int ub_probe_lun(struct ub_dev *s
+ int rc;
+
+ rc = -ENOMEM;
+- if ((lun = kmalloc(sizeof(struct ub_lun), GFP_KERNEL)) == NULL)
++ if ((lun = kzalloc(sizeof(struct ub_lun), GFP_KERNEL)) == NULL)
+ goto err_alloc;
+- memset(lun, 0, sizeof(struct ub_lun));
+ lun->num = lnum;
+
+ rc = -ENOSR;