Commit 3a6a7187 authored by Wan Jiabing's avatar Wan Jiabing Committed by Martin K. Petersen

scsi: megaraid_sas: Remove unnecessary memset

instance->cmd_list is allocated by kcalloc(). The memory is already set to
zero. It is unnecessary to call memset again.

Link: https://lore.kernel.org/r/20220407072442.4137977-1-wanjiabing@vivo.comAcked-by: default avatarSumit Saxena <sumit.saxena@broadcom.com>
Signed-off-by: default avatarWan Jiabing <wanjiabing@vivo.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 0848ccae
...@@ -4466,8 +4466,6 @@ int megasas_alloc_cmds(struct megasas_instance *instance) ...@@ -4466,8 +4466,6 @@ int megasas_alloc_cmds(struct megasas_instance *instance)
return -ENOMEM; return -ENOMEM;
} }
memset(instance->cmd_list, 0, sizeof(struct megasas_cmd *) *max_cmd);
for (i = 0; i < max_cmd; i++) { for (i = 0; i < max_cmd; i++) {
instance->cmd_list[i] = kmalloc(sizeof(struct megasas_cmd), instance->cmd_list[i] = kmalloc(sizeof(struct megasas_cmd),
GFP_KERNEL); GFP_KERNEL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment