diff options
Diffstat (limited to 'drivers/bluetooth/btwilink.c')
-rw-r--r-- | drivers/bluetooth/btwilink.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/bluetooth/btwilink.c b/drivers/bluetooth/btwilink.c index 88694697f34f..4ad7b35cfc0e 100644 --- a/drivers/bluetooth/btwilink.c +++ b/drivers/bluetooth/btwilink.c | |||
@@ -297,16 +297,14 @@ static int bt_ti_probe(struct platform_device *pdev) | |||
297 | struct hci_dev *hdev; | 297 | struct hci_dev *hdev; |
298 | int err; | 298 | int err; |
299 | 299 | ||
300 | hst = kzalloc(sizeof(struct ti_st), GFP_KERNEL); | 300 | hst = devm_kzalloc(&pdev->dev, sizeof(struct ti_st), GFP_KERNEL); |
301 | if (!hst) | 301 | if (!hst) |
302 | return -ENOMEM; | 302 | return -ENOMEM; |
303 | 303 | ||
304 | /* Expose "hciX" device to user space */ | 304 | /* Expose "hciX" device to user space */ |
305 | hdev = hci_alloc_dev(); | 305 | hdev = hci_alloc_dev(); |
306 | if (!hdev) { | 306 | if (!hdev) |
307 | kfree(hst); | ||
308 | return -ENOMEM; | 307 | return -ENOMEM; |
309 | } | ||
310 | 308 | ||
311 | BT_DBG("hdev %p", hdev); | 309 | BT_DBG("hdev %p", hdev); |
312 | 310 | ||
@@ -321,7 +319,6 @@ static int bt_ti_probe(struct platform_device *pdev) | |||
321 | err = hci_register_dev(hdev); | 319 | err = hci_register_dev(hdev); |
322 | if (err < 0) { | 320 | if (err < 0) { |
323 | BT_ERR("Can't register HCI device error %d", err); | 321 | BT_ERR("Can't register HCI device error %d", err); |
324 | kfree(hst); | ||
325 | hci_free_dev(hdev); | 322 | hci_free_dev(hdev); |
326 | return err; | 323 | return err; |
327 | } | 324 | } |
@@ -347,7 +344,6 @@ static int bt_ti_remove(struct platform_device *pdev) | |||
347 | hci_unregister_dev(hdev); | 344 | hci_unregister_dev(hdev); |
348 | 345 | ||
349 | hci_free_dev(hdev); | 346 | hci_free_dev(hdev); |
350 | kfree(hst); | ||
351 | 347 | ||
352 | dev_set_drvdata(&pdev->dev, NULL); | 348 | dev_set_drvdata(&pdev->dev, NULL); |
353 | return 0; | 349 | return 0; |