aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorPete Zaitcev <zaitcev@redhat.com>2006-02-13 20:35:57 -0800
committerGreg Kroah-Hartman <gregkh@suse.de>2006-03-20 14:49:54 -0800
commit29da7937a11a47bad64558c3be4d998c4ea5e823 (patch)
tree9e73a3de1ad7e50d70ba0f65c0c06905e9602fe2 /drivers/block
parent9ee884cc89dc339276c719ab4ff53913ac03d083 (diff)
downloadkernel_samsung_aries-29da7937a11a47bad64558c3be4d998c4ea5e823.zip
kernel_samsung_aries-29da7937a11a47bad64558c3be4d998c4ea5e823.tar.gz
kernel_samsung_aries-29da7937a11a47bad64558c3be4d998c4ea5e823.tar.bz2
[PATCH] ub: use kzalloc
Switch from kmalloc+memset to kzalloc. Signed-off-by: Pete Zaitcev <zaitcev@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/ub.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/block/ub.c b/drivers/block/ub.c
index f04d864..3e76894 100644
--- a/drivers/block/ub.c
+++ b/drivers/block/ub.c
@@ -2007,9 +2007,8 @@ static int ub_sync_tur(struct ub_dev *sc, struct ub_lun *lun)
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_dev *sc, struct ub_lun *lun,
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 *intf,
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 *sc, int lnum)
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;