Switch from kmalloc+memset to kzalloc.
Signed-off-by: Pete Zaitcev <zaitcev@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
init_completion(&compl);
rc = -ENOMEM;
init_completion(&compl);
rc = -ENOMEM;
- if ((cmd = kmalloc(ALLOC_SIZE, GFP_KERNEL)) == NULL)
+ if ((cmd = kzalloc(ALLOC_SIZE, GFP_KERNEL)) == NULL)
- memset(cmd, 0, ALLOC_SIZE);
cmd->cdb[0] = TEST_UNIT_READY;
cmd->cdb_len = 6;
cmd->cdb[0] = TEST_UNIT_READY;
cmd->cdb_len = 6;
init_completion(&compl);
rc = -ENOMEM;
init_completion(&compl);
rc = -ENOMEM;
- if ((cmd = kmalloc(ALLOC_SIZE, GFP_KERNEL)) == NULL)
+ if ((cmd = kzalloc(ALLOC_SIZE, GFP_KERNEL)) == NULL)
- memset(cmd, 0, ALLOC_SIZE);
p = (char *)cmd + sizeof(struct ub_scsi_cmd);
cmd->cdb[0] = 0x25;
p = (char *)cmd + sizeof(struct ub_scsi_cmd);
cmd->cdb[0] = 0x25;
return -ENXIO;
rc = -ENOMEM;
return -ENXIO;
rc = -ENOMEM;
- if ((sc = kmalloc(sizeof(struct ub_dev), GFP_KERNEL)) == NULL)
+ if ((sc = kzalloc(sizeof(struct ub_dev), GFP_KERNEL)) == NULL)
- memset(sc, 0, sizeof(struct ub_dev));
sc->lock = ub_next_lock();
INIT_LIST_HEAD(&sc->luns);
usb_init_urb(&sc->work_urb);
sc->lock = ub_next_lock();
INIT_LIST_HEAD(&sc->luns);
usb_init_urb(&sc->work_urb);
- if ((lun = kmalloc(sizeof(struct ub_lun), GFP_KERNEL)) == NULL)
+ if ((lun = kzalloc(sizeof(struct ub_lun), GFP_KERNEL)) == NULL)
- memset(lun, 0, sizeof(struct ub_lun));
lun->num = lnum;
rc = -ENOSR;
lun->num = lnum;
rc = -ENOSR;