diff options
author | Wei Yongjun <yjwei@cn.fujitsu.com> | 2009-03-04 15:06:13 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2009-04-03 11:16:31 -0400 |
commit | ebef264bd90abb8bcafe29e5ba5492da4f7d4492 (patch) | |
tree | 288c032bb0b050d53d2b012529d0962ce73ffd14 /drivers | |
parent | 0fdf96b67ac2649cc1ddb29b316a0db11586c6a8 (diff) |
[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')
-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) | |||
169 | { | 169 | { |
170 | struct scsi_cmnd *cmd; | 170 | struct scsi_cmnd *cmd; |
171 | 171 | ||
172 | cmd = kmem_cache_alloc(pool->cmd_slab, gfp_mask | pool->gfp_mask); | 172 | cmd = kmem_cache_zalloc(pool->cmd_slab, gfp_mask | pool->gfp_mask); |
173 | if (!cmd) | 173 | if (!cmd) |
174 | return NULL; | 174 | return NULL; |
175 | 175 | ||
176 | memset(cmd, 0, sizeof(*cmd)); | ||
177 | |||
178 | cmd->sense_buffer = kmem_cache_alloc(pool->sense_slab, | 176 | cmd->sense_buffer = kmem_cache_alloc(pool->sense_slab, |
179 | gfp_mask | pool->gfp_mask); | 177 | gfp_mask | pool->gfp_mask); |
180 | if (!cmd->sense_buffer) { | 178 | if (!cmd->sense_buffer) { |