Skip to content

Commit 0a80144

Browse files
committed
Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth
Johan Hedberg says: ==================== Here are a couple of important Bluetooth & mac802154 fixes for 4.1: - mac802154 fix for crypto algorithm allocation failure checking - mac802154 wpan phy leak fix for error code path - Fix for not calling Bluetooth shutdown() if interface is not up Let me know if there are any issues pulling. Thanks. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 31ccd0e + 89eb6d0 commit 0a80144

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

net/bluetooth/hci_core.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1557,7 +1557,8 @@ static int hci_dev_do_close(struct hci_dev *hdev)
15571557
{
15581558
BT_DBG("%s %p", hdev->name, hdev);
15591559

1560-
if (!hci_dev_test_flag(hdev, HCI_UNREGISTER)) {
1560+
if (!hci_dev_test_flag(hdev, HCI_UNREGISTER) &&
1561+
test_bit(HCI_UP, &hdev->flags)) {
15611562
/* Execute vendor specific shutdown routine */
15621563
if (hdev->shutdown)
15631564
hdev->shutdown(hdev);

net/mac802154/llsec.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ llsec_key_alloc(const struct ieee802154_llsec_key *template)
134134
for (i = 0; i < ARRAY_SIZE(key->tfm); i++) {
135135
key->tfm[i] = crypto_alloc_aead("ccm(aes)", 0,
136136
CRYPTO_ALG_ASYNC);
137-
if (!key->tfm[i])
137+
if (IS_ERR(key->tfm[i]))
138138
goto err_tfm;
139139
if (crypto_aead_setkey(key->tfm[i], template->key,
140140
IEEE802154_LLSEC_KEY_SIZE))
@@ -144,7 +144,7 @@ llsec_key_alloc(const struct ieee802154_llsec_key *template)
144144
}
145145

146146
key->tfm0 = crypto_alloc_blkcipher("ctr(aes)", 0, CRYPTO_ALG_ASYNC);
147-
if (!key->tfm0)
147+
if (IS_ERR(key->tfm0))
148148
goto err_tfm;
149149

150150
if (crypto_blkcipher_setkey(key->tfm0, template->key,

net/mac802154/main.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,13 +167,15 @@ int ieee802154_register_hw(struct ieee802154_hw *hw)
167167
if (IS_ERR(dev)) {
168168
rtnl_unlock();
169169
rc = PTR_ERR(dev);
170-
goto out_wq;
170+
goto out_phy;
171171
}
172172

173173
rtnl_unlock();
174174

175175
return 0;
176176

177+
out_phy:
178+
wpan_phy_unregister(local->phy);
177179
out_wq:
178180
destroy_workqueue(local->workqueue);
179181
out:

0 commit comments

Comments
 (0)