All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] megaraid_sas: fix missing { }, nullify kbuff_arr[i] only when necessary
@ 2016-03-20 17:03 Colin King
  2016-03-22  0:31 ` Martin K. Petersen
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Colin King @ 2016-03-20 17:03 UTC (permalink / raw)
  To: Kashyap Desai, Sumit Saxena, James Bottomley,
	Martin K . Petersen, megaraidlinux.pdl, linux-scsi
  Cc: linux-kernel

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

Fix missing { } on if statement, this change will nullify kbuff_arr[i]
only where necessary as the code intended.

detected using static analysis with smatch

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 69d375b..e6ebc7a 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -6656,12 +6656,13 @@ out:
 	}
 
 	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.7.3

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

end of thread, other threads:[~2016-03-23 20:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-20 17:03 [PATCH] megaraid_sas: fix missing { }, nullify kbuff_arr[i] only when necessary Colin King
2016-03-22  0:31 ` Martin K. Petersen
2016-03-22 11:42 ` Sumit Saxena
2016-03-23 20:44 ` Martin K. Petersen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.