public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: Remove unnecessary NULL check before vfree()
@ 2023-08-07  2:32 Ziyang Xuan
  2023-08-07  3:16 ` bluez.test.bot
  2023-08-07 22:50 ` [PATCH] " patchwork-bot+bluetooth
  0 siblings, 2 replies; 3+ messages in thread
From: Ziyang Xuan @ 2023-08-07  2:32 UTC (permalink / raw)
  To: marcel, johan.hedberg, luiz.dentz, linux-bluetooth; +Cc: william.xuanziyang

Get a coccinelle warning as follows:
net/bluetooth/coredump.c:104:2-7: WARNING: NULL check before some freeing functions is not needed.

Remove the unnecessary NULL check.

Signed-off-by: Ziyang Xuan <william.xuanziyang@huawei.com>
---
 net/bluetooth/coredump.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/net/bluetooth/coredump.c b/net/bluetooth/coredump.c
index d2d2624ec708..ec97a4bab1c9 100644
--- a/net/bluetooth/coredump.c
+++ b/net/bluetooth/coredump.c
@@ -100,8 +100,7 @@ void hci_devcd_reset(struct hci_dev *hdev)
 /* Call with hci_dev_lock only. */
 static void hci_devcd_free(struct hci_dev *hdev)
 {
-	if (hdev->dump.head)
-		vfree(hdev->dump.head);
+	vfree(hdev->dump.head);
 
 	hci_devcd_reset(hdev);
 }
-- 
2.25.1


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

end of thread, other threads:[~2023-08-07 22:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-07  2:32 [PATCH] Bluetooth: Remove unnecessary NULL check before vfree() Ziyang Xuan
2023-08-07  3:16 ` bluez.test.bot
2023-08-07 22:50 ` [PATCH] " patchwork-bot+bluetooth

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