From ebef264bd90abb8bcafe29e5ba5492da4f7d4492 Mon Sep 17 00:00:00 2001 From: Wei Yongjun Date: Wed, 4 Mar 2009 12:06:13 -0800 Subject: [SCSI] use kmem_cache_zalloc instead of kmem_cache_alloc/memset Signed-off-by: Wei Yongjun Signed-off-by: Andrew Morton Signed-off-by: James Bottomley --- drivers/scsi/scsi.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'drivers/scsi') diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c index a2ef032..166417a 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) { -- cgit v1.1