Skip to content

Commit

Permalink
Bluetooth: Remove unnecessary NULL check before vfree()
Browse files Browse the repository at this point in the history
Remove unnecessary NULL check which causes coccinelle warning:

net/bluetooth/coredump.c:104:2-7: WARNING: NULL check before some
freeing functions is not needed.

Signed-off-by: Ziyang Xuan <william.xuanziyang@huawei.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
  • Loading branch information
Ziyang Xuan authored and Luiz Augusto von Dentz committed Aug 11, 2023
1 parent a2bcd2b commit 3cd43dd
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions net/bluetooth/coredump.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 3cd43dd

Please sign in to comment.