Browse Source

Bluetooth: Use list_del when freeing the list entry

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 <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Johan Hedberg 11 năm trước cách đây
mục cha
commit
d1dbf12e3b
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      net/bluetooth/mgmt.c

+ 1 - 1
net/bluetooth/mgmt.c

@@ -5225,7 +5225,7 @@ static int remove_device(struct sock *sk, struct hci_dev *hdev,
 			goto unlock;
 		}
 
-		list_del_init(&params->action);
+		list_del(&params->action);
 		list_del(&params->list);
 		kfree(params);
 		hci_update_background_scan(hdev);