From: Wei Yongjun <yjwei@xxxxxxxxxxxxxx> Used kmem_cache_zalloc instead of kmem_cache_alloc/memset. Signed-off-by: Wei Yongjun <yjwei@xxxxxxxxxxxxxx> Cc: James Bottomley <James.Bottomley@xxxxxxxxxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- drivers/scsi/scsi.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff -puN drivers/scsi/scsi.c~scsi-used-kmem_cache_zalloc-instead-of-kmem_cache_alloc-memset drivers/scsi/scsi.c --- a/drivers/scsi/scsi.c~scsi-used-kmem_cache_zalloc-instead-of-kmem_cache_alloc-memset +++ a/drivers/scsi/scsi.c @@ -169,12 +169,10 @@ scsi_pool_alloc_command(struct scsi_host { 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) { _ -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html