* [PATCH] mfd: viperboard: remove redundant NULL check before kfree()
@ 2026-07-03 10:59 mdshahid03
2026-07-09 9:46 ` (subset) " Lee Jones
0 siblings, 1 reply; 2+ messages in thread
From: mdshahid03 @ 2026-07-03 10:59 UTC (permalink / raw)
To: Lee Jones; +Cc: mfd, linux-kernel, Mohammad Shahid
From: Mohammad Shahid <mdshahid03@gmail.com>
kfree() safely handles NULL pointers, so the explicit NULL check
before calling kfree() is unnecessary.
This issue was reported by ifnullfree.cocci.
Signed-off-by: Mohammad Shahid <mdshahid03@gmail.com>
---
drivers/mfd/viperboard.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/mfd/viperboard.c b/drivers/mfd/viperboard.c
index 888737b8e7be..36be8e69f45c 100644
--- a/drivers/mfd/viperboard.c
+++ b/drivers/mfd/viperboard.c
@@ -96,8 +96,7 @@ static int vprbrd_probe(struct usb_interface *interface,
return 0;
error:
- if (vb)
- kfree(vb);
+ kfree(vb);
return ret;
}
--
2.43.0
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-07-09 9:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-03 10:59 [PATCH] mfd: viperboard: remove redundant NULL check before kfree() mdshahid03
2026-07-09 9:46 ` (subset) " Lee Jones
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®