diff options
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/dvb/dvb-usb/cxusb.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/drivers/media/dvb/dvb-usb/cxusb.c b/drivers/media/dvb/dvb-usb/cxusb.c index 720fcd1c3c1d..0286156704f2 100644 --- a/drivers/media/dvb/dvb-usb/cxusb.c +++ b/drivers/media/dvb/dvb-usb/cxusb.c | |||
@@ -24,6 +24,7 @@ | |||
24 | * see Documentation/dvb/README.dvb-usb for more information | 24 | * see Documentation/dvb/README.dvb-usb for more information |
25 | */ | 25 | */ |
26 | #include <media/tuner.h> | 26 | #include <media/tuner.h> |
27 | #include <linux/vmalloc.h> | ||
27 | 28 | ||
28 | #include "cxusb.h" | 29 | #include "cxusb.h" |
29 | 30 | ||
@@ -700,12 +701,26 @@ static int bluebird_patch_dvico_firmware_download(struct usb_device *udev, | |||
700 | 701 | ||
701 | if (fw->data[idoff] == (USB_VID_DVICO & 0xff) && | 702 | if (fw->data[idoff] == (USB_VID_DVICO & 0xff) && |
702 | fw->data[idoff + 1] == USB_VID_DVICO >> 8) { | 703 | fw->data[idoff + 1] == USB_VID_DVICO >> 8) { |
703 | fw->data[idoff + 2] = | 704 | struct firmware new_fw; |
705 | u8 *new_fw_data = vmalloc(fw->size); | ||
706 | int ret; | ||
707 | |||
708 | if (!new_fw_data) | ||
709 | return -ENOMEM; | ||
710 | |||
711 | memcpy(new_fw_data, fw->data, fw->size); | ||
712 | new_fw.size = fw->size; | ||
713 | new_fw.data = new_fw_data; | ||
714 | |||
715 | new_fw_data[idoff + 2] = | ||
704 | le16_to_cpu(udev->descriptor.idProduct) + 1; | 716 | le16_to_cpu(udev->descriptor.idProduct) + 1; |
705 | fw->data[idoff + 3] = | 717 | new_fw_data[idoff + 3] = |
706 | le16_to_cpu(udev->descriptor.idProduct) >> 8; | 718 | le16_to_cpu(udev->descriptor.idProduct) >> 8; |
707 | 719 | ||
708 | return usb_cypress_load_firmware(udev, fw, CYPRESS_FX2); | 720 | ret = usb_cypress_load_firmware(udev, &new_fw, |
721 | CYPRESS_FX2); | ||
722 | vfree(new_fw_data); | ||
723 | return ret; | ||
709 | } | 724 | } |
710 | } | 725 | } |
711 | 726 | ||