Skip to content

Commit 5b6e810

Browse files
arndbgregkh
authored andcommitted
megaraid_sas: add missing curly braces in ioctl handler
commit 3deb9438d34a09f6796639b652a01d110aca9f75 upstream. gcc-6 found a dubious indentation in the megasas_mgmt_fw_ioctl function: drivers/scsi/megaraid/megaraid_sas_base.c: In function 'megasas_mgmt_fw_ioctl': drivers/scsi/megaraid/megaraid_sas_base.c:6658:4: warning: statement is indented as if it were guarded by... [-Wmisleading-indentation] kbuff_arr[i] = NULL; ^~~~~~~~~ drivers/scsi/megaraid/megaraid_sas_base.c:6653:3: note: ...this 'if' clause, but it is not if (kbuff_arr[i]) ^~ The code is actually correct, as there is no downside in clearing a NULL pointer again. This clarifies the code and avoids the warning by adding extra curly braces. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Fixes: 90dc9d9 ("megaraid_sas : MFI MPT linked list corruption fix") Reviewed-by: Hannes Reinecke <hare@suse.com> Acked-by: Sumit Saxena <sumit.saxena@broadcom.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 03d8623 commit 5b6e810

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/scsi/megaraid/megaraid_sas_base.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6282,12 +6282,13 @@ megasas_mgmt_fw_ioctl(struct megasas_instance *instance,
62826282
}
62836283

62846284
for (i = 0; i < ioc->sge_count; i++) {
6285-
if (kbuff_arr[i])
6285+
if (kbuff_arr[i]) {
62866286
dma_free_coherent(&instance->pdev->dev,
62876287
le32_to_cpu(kern_sge32[i].length),
62886288
kbuff_arr[i],
62896289
le32_to_cpu(kern_sge32[i].phys_addr));
62906290
kbuff_arr[i] = NULL;
6291+
}
62916292
}
62926293

62936294
megasas_return_cmd(instance, cmd);

0 commit comments

Comments
 (0)