|
@@ -568,22 +568,23 @@ static int bfusb_load_firmware(struct bfusb_data *data,
|
|
|
|
|
|
BT_INFO("BlueFRITZ! USB loading firmware");
|
|
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);
|
|
pipe = usb_sndctrlpipe(data->udev, 0);
|
|
|
|
|
|
if (usb_control_msg(data->udev, pipe, USB_REQ_SET_CONFIGURATION,
|
|
if (usb_control_msg(data->udev, pipe, USB_REQ_SET_CONFIGURATION,
|
|
0, 1, 0, NULL, 0, USB_CTRL_SET_TIMEOUT) < 0) {
|
|
0, 1, 0, NULL, 0, USB_CTRL_SET_TIMEOUT) < 0) {
|
|
BT_ERR("Can't change to loading configuration");
|
|
BT_ERR("Can't change to loading configuration");
|
|
|
|
+ kfree(buf);
|
|
return -EBUSY;
|
|
return -EBUSY;
|
|
}
|
|
}
|
|
|
|
|
|
data->udev->toggle[0] = data->udev->toggle[1] = 0;
|
|
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);
|
|
pipe = usb_sndbulkpipe(data->udev, data->bulk_out_ep);
|
|
|
|
|
|
while (count) {
|
|
while (count) {
|