mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 01:49:46 +00:00
megaraid_sas: add missing curly braces in ioctl handler
commit3deb9438d3upstream. 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:90dc9d98f0("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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
03d8623700
commit
5b6e810f35
@@ -6282,12 +6282,13 @@ out:
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < ioc->sge_count; i++) {
|
for (i = 0; i < ioc->sge_count; i++) {
|
||||||
if (kbuff_arr[i])
|
if (kbuff_arr[i]) {
|
||||||
dma_free_coherent(&instance->pdev->dev,
|
dma_free_coherent(&instance->pdev->dev,
|
||||||
le32_to_cpu(kern_sge32[i].length),
|
le32_to_cpu(kern_sge32[i].length),
|
||||||
kbuff_arr[i],
|
kbuff_arr[i],
|
||||||
le32_to_cpu(kern_sge32[i].phys_addr));
|
le32_to_cpu(kern_sge32[i].phys_addr));
|
||||||
kbuff_arr[i] = NULL;
|
kbuff_arr[i] = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
megasas_return_cmd(instance, cmd);
|
megasas_return_cmd(instance, cmd);
|
||||||
|
|||||||
Reference in New Issue
Block a user