mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] megaraid_sas: fix missing { } braces
@ 2015-08-03 15:00 Colin King
  2015-08-04  6:47 ` Johannes Thumshirn
  0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2015-08-03 15:00 UTC (permalink / raw)
  To: Kashyap Desai, Sumit Saxena, Uday Lingala, James E.J. Bottomley,
	megaraidlinux.pdl, linux-scsi
  Cc: linux-kernel

From: Colin Ian King <colin.king@canonical.com>

Static analysis by smatch indicated that there was a curly
braces issue:

drivers/scsi/megaraid/megaraid_sas_base.c:6139
  megasas_mgmt_fw_ioctl() warn: curly braces intended?

Add braces in the appropriate place so that kbuf_arr[i] gets
set to NULL only when we need to.  Also, remove whitespace
between kbuff_arr and [].

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/scsi/megaraid/megaraid_sas_base.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
index 71b884d..8face78 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -6131,12 +6131,13 @@ megasas_mgmt_fw_ioctl(struct megasas_instance *instance,
 	}
 
 	for (i = 0; i < ioc->sge_count; i++) {
-		if (kbuff_arr[i])
+		if (kbuff_arr[i]) {
 			dma_free_coherent(&instance->pdev->dev,
 					  le32_to_cpu(kern_sge32[i].length),
 					  kbuff_arr[i],
 					  le32_to_cpu(kern_sge32[i].phys_addr));
 			kbuff_arr[i] = NULL;
+		}
 	}
 
 	megasas_return_cmd(instance, cmd);
-- 
2.5.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-08-04  6:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-03 15:00 [PATCH] megaraid_sas: fix missing { } braces Colin King
2015-08-04  6:47 ` Johannes Thumshirn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome