Skip to content

Commit

Permalink
[SCSI] use kmem_cache_zalloc instead of kmem_cache_alloc/memset
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Wei Yongjun authored and James Bottomley committed Apr 3, 2009
1 parent 0fdf96b commit ebef264
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/scsi/scsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit ebef264

Please sign in to comment.