]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[SCSI] use kmem_cache_zalloc instead of kmem_cache_alloc/memset
authorWei Yongjun <yjwei@cn.fujitsu.com>
Wed, 4 Mar 2009 20:06:13 +0000 (12:06 -0800)
committerJames Bottomley <James.Bottomley@HansenPartnership.com>
Fri, 3 Apr 2009 15:16:31 +0000 (10:16 -0500)
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>
drivers/scsi/scsi.c

index a2ef03243a2c3d53d5fc719be830a4e42eebdea1..166417a6afbab0ceb2a30dec46a1cfddeb02a5a1 100644 (file)
@@ -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) {