diff options
author | Wei Yongjun <yjwei@cn.fujitsu.com> | 2009-03-04 21:06:13 +0100 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2009-04-03 17:16:31 +0200 |
commit | ebef264bd90abb8bcafe29e5ba5492da4f7d4492 (patch) | |
tree | 288c032bb0b050d53d2b012529d0962ce73ffd14 /drivers/scsi | |
parent | [SCSI] sg: fix iovec bugs introduced by the block layer conversion (diff) | |
download | linux-ebef264bd90abb8bcafe29e5ba5492da4f7d4492.tar.xz linux-ebef264bd90abb8bcafe29e5ba5492da4f7d4492.zip |
[SCSI] use kmem_cache_zalloc instead of kmem_cache_alloc/memset
Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/scsi.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c index a2ef03243a2c..166417a6afba 100644 --- a/drivers/scsi/scsi.c +++ b/drivers/scsi/scsi.c @@ -169,12 +169,10 @@ scsi_pool_alloc_command(struct scsi_host_cmd_pool *pool, gfp_t gfp_mask) { struct scsi_cmnd *cmd; - cmd = kmem_cache_alloc(pool->cmd_slab, gfp_mask | pool->gfp_mask); + cmd = kmem_cache_zalloc(pool->cmd_slab, gfp_mask | pool->gfp_mask); if (!cmd) return NULL; - memset(cmd, 0, sizeof(*cmd)); - cmd->sense_buffer = kmem_cache_alloc(pool->sense_slab, gfp_mask | pool->gfp_mask); if (!cmd->sense_buffer) { |