Bluetooth: Use list_del when freeing the list entry
Subsystems (2)
PATCH 1/1 Bluetooth: Use list_del when freeing the list entry
From: Johan Hedberg <[email protected]>
It's wasteful to use list_del_init (which re-initializes the list_head) if we're just about to free the element and never use it again.
Signed-off-by Johan Hedberg <[email protected]>
--- net/bluetooth/mgmt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/bluetooth/mgmt.c +1 -1
@@ -5225,7 +5225,7 @@ static int remove_device(struct sock *sk, struct hci_dev *hdev, goto unlock; } -list_del_init (¶ms->action); +list_del (¶ms->action);list_del (¶ms->list);kfree (params);hci_update_background_scan (hdev);
Signature · 1 line
1.9.3
Marcel Holtmann
maintainerHi Johan,
Quoted 7 lines
It's wasteful to use
list_del_init(which re-initializes thelist_head) if we're just about to free the element and never use it again.Signed-off-by Johan Hedberg <[email protected]>---
net/bluetooth/mgmt.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)
patch has been applied to bluetooth-next tree.
Regards
Marcel