* [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
* Re: (subset) [PATCH] mfd: viperboard: remove redundant NULL check before kfree()
2026-07-03 10:59 [PATCH] mfd: viperboard: remove redundant NULL check before kfree() mdshahid03
@ 2026-07-09 9:46 ` Lee Jones
0 siblings, 0 replies; 2+ messages in thread
From: Lee Jones @ 2026-07-09 9:46 UTC (permalink / raw)
To: Lee Jones, mdshahid03; +Cc: mfd, linux-kernel
On Fri, 03 Jul 2026 16:29:37 +0530, mdshahid03@gmail.com wrote:
> kfree() safely handles NULL pointers, so the explicit NULL check
> before calling kfree() is unnecessary.
>
> This issue was reported by ifnullfree.cocci.
Applied, thanks!
[1/1] mfd: viperboard: remove redundant NULL check before kfree()
commit: cf9775233b4d1618dfac5e84009f36eba1e7fddc
--
Lee Jones [李琼斯]
^ 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