Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 327493
b: refs/heads/master
c: 98921db
h: refs/heads/master
i:
  327491: c6f2f2c
v: v3
  • Loading branch information
Sachin Kamat authored and Gustavo Padovan committed Aug 6, 2012
1 parent 06ae91a commit 45947af
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fdefa118ebbcadad4adbaaab067be06a96a48e15
refs/heads/master: 98921dbd00c4e2e4bdd56423cb5edf98d57b45f7
13 changes: 3 additions & 10 deletions trunk/drivers/bluetooth/btusb.c
Original file line number Diff line number Diff line change
Expand Up @@ -952,7 +952,7 @@ static int btusb_probe(struct usb_interface *intf,
return -ENODEV;
}

data = kzalloc(sizeof(*data), GFP_KERNEL);
data = devm_kzalloc(&intf->dev, sizeof(*data), GFP_KERNEL);
if (!data)
return -ENOMEM;

Expand All @@ -975,10 +975,8 @@ static int btusb_probe(struct usb_interface *intf,
}
}

if (!data->intr_ep || !data->bulk_tx_ep || !data->bulk_rx_ep) {
kfree(data);
if (!data->intr_ep || !data->bulk_tx_ep || !data->bulk_rx_ep)
return -ENODEV;
}

data->cmdreq_type = USB_TYPE_CLASS;

Expand All @@ -998,10 +996,8 @@ static int btusb_probe(struct usb_interface *intf,
init_usb_anchor(&data->deferred);

hdev = hci_alloc_dev();
if (!hdev) {
kfree(data);
if (!hdev)
return -ENOMEM;
}

hdev->bus = HCI_USB;
hci_set_drvdata(hdev, data);
Expand Down Expand Up @@ -1069,15 +1065,13 @@ static int btusb_probe(struct usb_interface *intf,
data->isoc, data);
if (err < 0) {
hci_free_dev(hdev);
kfree(data);
return err;
}
}

err = hci_register_dev(hdev);
if (err < 0) {
hci_free_dev(hdev);
kfree(data);
return err;
}

Expand Down Expand Up @@ -1110,7 +1104,6 @@ static void btusb_disconnect(struct usb_interface *intf)
usb_driver_release_interface(&btusb_driver, data->isoc);

hci_free_dev(hdev);
kfree(data);
}

#ifdef CONFIG_PM
Expand Down

0 comments on commit 45947af

Please sign in to comment.