All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scsi: megaraid_sas: remove redundant NULL check
@ 2021-01-22  9:23 Yang Li
  2021-01-22  9:41 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Yang Li @ 2021-01-22  9:23 UTC (permalink / raw)
  To: mchehab; +Cc: sakari.ailus, gregkh, linux-media, devel, linux-kernel, Yang Li

Fix below warnings reported by coccicheck:
./drivers/scsi/megaraid/megaraid_sas_fusion.c:3924:3-8: WARNING: NULL
check before some freeing functions is not needed.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <abaci-bugfix@linux.alibaba.com>
---
 drivers/scsi/megaraid/megaraid_sas_fusion.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c
index fd60728..38fc946 100644
--- a/drivers/scsi/megaraid/megaraid_sas_fusion.c
+++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c
@@ -3920,8 +3920,7 @@ static irqreturn_t megasas_isr_fusion(int irq, void *devp)
 {
 	unsigned int i;
 	for (i = 0; i < instance->drv_buf_alloc; i++) {
-		if (instance->crash_buf[i])
-			vfree(instance->crash_buf[i]);
+		vfree(instance->crash_buf[i]);
 	}
 	instance->drv_buf_index = 0;
 	instance->drv_buf_alloc = 0;
-- 
1.8.3.1


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

* Re: [PATCH] scsi: megaraid_sas: remove redundant NULL check
  2021-01-22  9:23 [PATCH] scsi: megaraid_sas: remove redundant NULL check Yang Li
@ 2021-01-22  9:41 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2021-01-22  9:41 UTC (permalink / raw)
  To: Yang Li; +Cc: mchehab, devel, linux-kernel, sakari.ailus, linux-media

On Fri, Jan 22, 2021 at 05:23:44PM +0800, Yang Li wrote:
> Fix below warnings reported by coccicheck:
> ./drivers/scsi/megaraid/megaraid_sas_fusion.c:3924:3-8: WARNING: NULL
> check before some freeing functions is not needed.
> 
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Yang Li <abaci-bugfix@linux.alibaba.com>
> ---
>  drivers/scsi/megaraid/megaraid_sas_fusion.c | 3 +--

Please always use scripts/get_maintainer.pl to determine who to send
patches to, and what mailing list, otherwise they will just be ignored,
like this one :(

thanks,

greg k-h

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

end of thread, other threads:[~2021-01-22 10:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-22  9:23 [PATCH] scsi: megaraid_sas: remove redundant NULL check Yang Li
2021-01-22  9:41 ` Greg KH

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.