diff options
-rw-r--r-- | drivers/bluetooth/btsdio.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/bluetooth/btsdio.c b/drivers/bluetooth/btsdio.c index e10ea0347051..4a9909713874 100644 --- a/drivers/bluetooth/btsdio.c +++ b/drivers/bluetooth/btsdio.c | |||
@@ -304,7 +304,7 @@ static int btsdio_probe(struct sdio_func *func, | |||
304 | tuple = tuple->next; | 304 | tuple = tuple->next; |
305 | } | 305 | } |
306 | 306 | ||
307 | data = kzalloc(sizeof(*data), GFP_KERNEL); | 307 | data = devm_kzalloc(&func->dev, sizeof(*data), GFP_KERNEL); |
308 | if (!data) | 308 | if (!data) |
309 | return -ENOMEM; | 309 | return -ENOMEM; |
310 | 310 | ||
@@ -315,10 +315,8 @@ static int btsdio_probe(struct sdio_func *func, | |||
315 | skb_queue_head_init(&data->txq); | 315 | skb_queue_head_init(&data->txq); |
316 | 316 | ||
317 | hdev = hci_alloc_dev(); | 317 | hdev = hci_alloc_dev(); |
318 | if (!hdev) { | 318 | if (!hdev) |
319 | kfree(data); | ||
320 | return -ENOMEM; | 319 | return -ENOMEM; |
321 | } | ||
322 | 320 | ||
323 | hdev->bus = HCI_SDIO; | 321 | hdev->bus = HCI_SDIO; |
324 | hci_set_drvdata(hdev, data); | 322 | hci_set_drvdata(hdev, data); |
@@ -340,7 +338,6 @@ static int btsdio_probe(struct sdio_func *func, | |||
340 | err = hci_register_dev(hdev); | 338 | err = hci_register_dev(hdev); |
341 | if (err < 0) { | 339 | if (err < 0) { |
342 | hci_free_dev(hdev); | 340 | hci_free_dev(hdev); |
343 | kfree(data); | ||
344 | return err; | 341 | return err; |
345 | } | 342 | } |
346 | 343 | ||
@@ -366,7 +363,6 @@ static void btsdio_remove(struct sdio_func *func) | |||
366 | hci_unregister_dev(hdev); | 363 | hci_unregister_dev(hdev); |
367 | 364 | ||
368 | hci_free_dev(hdev); | 365 | hci_free_dev(hdev); |
369 | kfree(data); | ||
370 | } | 366 | } |
371 | 367 | ||
372 | static struct sdio_driver btsdio_driver = { | 368 | static struct sdio_driver btsdio_driver = { |