summaryrefslogtreecommitdiff
path: root/drivers/bluetooth/bfusb.c
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2011-11-02 15:15:51 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-11-02 15:15:51 -0400
commitc125d5e846894043361c0c89c1140be8fd6600b7 (patch)
tree8c613b696dc65b047ae6660e55abcd0c008be490 /drivers/bluetooth/bfusb.c
parent6a32e4f9dd9219261f8856f817e6655114cfec2f (diff)
parent6b441fab28ea1cbbf3da75dcd1e7438e6cba704c (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/padovan/bluetooth
Diffstat (limited to 'drivers/bluetooth/bfusb.c')
-rw-r--r--drivers/bluetooth/bfusb.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/bluetooth/bfusb.c b/drivers/bluetooth/bfusb.c
index 005919ab043c..61b591470a90 100644
--- a/drivers/bluetooth/bfusb.c
+++ b/drivers/bluetooth/bfusb.c
@@ -568,22 +568,23 @@ static int bfusb_load_firmware(struct bfusb_data *data,
BT_INFO("BlueFRITZ! USB loading firmware");
+ buf = kmalloc(BFUSB_MAX_BLOCK_SIZE + 3, GFP_KERNEL);
+ if (!buf) {
+ BT_ERR("Can't allocate memory chunk for firmware");
+ return -ENOMEM;
+ }
+
pipe = usb_sndctrlpipe(data->udev, 0);
if (usb_control_msg(data->udev, pipe, USB_REQ_SET_CONFIGURATION,
0, 1, 0, NULL, 0, USB_CTRL_SET_TIMEOUT) < 0) {
BT_ERR("Can't change to loading configuration");
+ kfree(buf);
return -EBUSY;
}
data->udev->toggle[0] = data->udev->toggle[1] = 0;
- buf = kmalloc(BFUSB_MAX_BLOCK_SIZE + 3, GFP_ATOMIC);
- if (!buf) {
- BT_ERR("Can't allocate memory chunk for firmware");
- return -ENOMEM;
- }
-
pipe = usb_sndbulkpipe(data->udev, data->bulk_out_ep);
while (count) {