Skip to contentSkip to conversation

bluetooth: unlock if allocation fails in hci_blacklist_add()

PATCH In review Dan Carpenter 2 participants 2 messages Aug 3, 2011 – Aug 11, 2011

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bluetooth: unlock if allocation fails in hci_blacklist_add()

There was a small typo here so we never actually hit the goto which would call hci_dev_unlock_bh().

net/bluetooth/hci_core.c +1 -1
index baaf5eb..56943ad 100644
@@ -1326,7 +1326,7 @@ int hci_blacklist_add(struct hci_dev *hdev, bdaddr_t *bdaddr)
 
 	entry = kzalloc(sizeof(struct bdaddr_list), GFP_KERNEL);
 	if (!entry) {
-		return -ENOMEM;
+		err = -ENOMEM;
 		goto err;
 	}
 
#1 lore raw

Re: [patch] bluetooth: unlock if allocation fails in

Hi Dan,

Quoted 10 lines · Dan Carpenter

There was a small typo here so we never actually hit the goto which would call hci_dev_unlock_bh().

net/bluetooth/hci_core.c +0 -0
index baaf5eb..56943ad 100644

net/bluetooth/hci_core.c int hci_blacklist_add(struct hci_dev *hdev, bdaddr_t *bdaddr) · line 1331

Quoted 7 lines
net/bluetooth/hci_core.c +1 -1
@@ -1326,7 +1326,7 @@ int hci_blacklist_add(struct hci_dev *hdev, bdaddr_t *bdaddr)
 
 	entry = kzalloc(sizeof(struct bdaddr_list), GFP_KERNEL);
 	if (!entry) {
-		return -ENOMEM;
+		err = -ENOMEM;
 		goto err;
 	}

Patch has been applied, thanks.

Gustavo