aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorPete Zaitcev <zaitcev@redhat.com>2006-02-13 23:35:57 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2006-03-20 17:49:54 -0500
commit29da7937a11a47bad64558c3be4d998c4ea5e823 (patch)
tree9e73a3de1ad7e50d70ba0f65c0c06905e9602fe2 /drivers/block
parent9ee884cc89dc339276c719ab4ff53913ac03d083 (diff)
[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 f04d864770ad..3e7689494c66 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)
2007 init_completion(&compl); 2007 init_completion(&compl);
2008 2008
2009 rc = -ENOMEM; 2009 rc = -ENOMEM;
2010 if ((cmd = kmalloc(ALLOC_SIZE, GFP_KERNEL)) == NULL) 2010 if ((cmd = kzalloc(ALLOC_SIZE, GFP_KERNEL)) == NULL)
2011 goto err_alloc; 2011 goto err_alloc;
2012 memset(cmd, 0, ALLOC_SIZE);
2013 2012
2014 cmd->cdb[0] = TEST_UNIT_READY; 2013 cmd->cdb[0] = TEST_UNIT_READY;
2015 cmd->cdb_len = 6; 2014 cmd->cdb_len = 6;
@@ -2062,9 +2061,8 @@ static int ub_sync_read_cap(struct ub_dev *sc, struct ub_lun *lun,
2062 init_completion(&compl); 2061 init_completion(&compl);
2063 2062
2064 rc = -ENOMEM; 2063 rc = -ENOMEM;
2065 if ((cmd = kmalloc(ALLOC_SIZE, GFP_KERNEL)) == NULL) 2064 if ((cmd = kzalloc(ALLOC_SIZE, GFP_KERNEL)) == NULL)
2066 goto err_alloc; 2065 goto err_alloc;
2067 memset(cmd, 0, ALLOC_SIZE);
2068 p = (char *)cmd + sizeof(struct ub_scsi_cmd); 2066 p = (char *)cmd + sizeof(struct ub_scsi_cmd);
2069 2067
2070 cmd->cdb[0] = 0x25; 2068 cmd->cdb[0] = 0x25;
@@ -2405,9 +2403,8 @@ static int ub_probe(struct usb_interface *intf,
2405 return -ENXIO; 2403 return -ENXIO;
2406 2404
2407 rc = -ENOMEM; 2405 rc = -ENOMEM;
2408 if ((sc = kmalloc(sizeof(struct ub_dev), GFP_KERNEL)) == NULL) 2406 if ((sc = kzalloc(sizeof(struct ub_dev), GFP_KERNEL)) == NULL)
2409 goto err_core; 2407 goto err_core;
2410 memset(sc, 0, sizeof(struct ub_dev));
2411 sc->lock = ub_next_lock(); 2408 sc->lock = ub_next_lock();
2412 INIT_LIST_HEAD(&sc->luns); 2409 INIT_LIST_HEAD(&sc->luns);
2413 usb_init_urb(&sc->work_urb); 2410 usb_init_urb(&sc->work_urb);
@@ -2524,9 +2521,8 @@ static int ub_probe_lun(struct ub_dev *sc, int lnum)
2524 int rc; 2521 int rc;
2525 2522
2526 rc = -ENOMEM; 2523 rc = -ENOMEM;
2527 if ((lun = kmalloc(sizeof(struct ub_lun), GFP_KERNEL)) == NULL) 2524 if ((lun = kzalloc(sizeof(struct ub_lun), GFP_KERNEL)) == NULL)
2528 goto err_alloc; 2525 goto err_alloc;
2529 memset(lun, 0, sizeof(struct ub_lun));
2530 lun->num = lnum; 2526 lun->num = lnum;
2531 2527
2532 rc = -ENOSR; 2528 rc = -ENOSR;