Firmware is retained unreleased for the entire duration of the
driver.
When done release firmware and if the need be request firmware again.
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
struct net_device* dev;
struct net_device_stats stats;
struct net_device* dev;
struct net_device_stats stats;
- const struct firmware *firmware;
+ struct device *dev = &pDevice->usb->dev;
const struct firmware *fw;
int NdisStatus;
void *pBuffer = NULL;
BOOL result = FALSE;
u16 wLength;
const struct firmware *fw;
int NdisStatus;
void *pBuffer = NULL;
BOOL result = FALSE;
u16 wLength;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"---->Download firmware\n");
spin_unlock_irq(&pDevice->lock);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"---->Download firmware\n");
spin_unlock_irq(&pDevice->lock);
- if (!pDevice->firmware) {
- struct device *dev = &pDevice->usb->dev;
- int rc;
-
- rc = request_firmware(&pDevice->firmware, FIRMWARE_NAME, dev);
- if (rc) {
- dev_err(dev, "firmware file %s request failed (%d)\n",
- FIRMWARE_NAME, rc);
+ rc = request_firmware(&fw, FIRMWARE_NAME, dev);
+ if (rc) {
+ dev_err(dev, "firmware file %s request failed (%d)\n",
+ FIRMWARE_NAME, rc);
- fw = pDevice->firmware;
pBuffer = kmalloc(FIRMWARE_CHUNK_SIZE, GFP_KERNEL);
if (!pBuffer)
pBuffer = kmalloc(FIRMWARE_CHUNK_SIZE, GFP_KERNEL);
if (!pBuffer)
DBG_PRT(MSG_LEVEL_DEBUG,
KERN_INFO"Download firmware...%d %zu\n", ii, fw->size);
if (NdisStatus != STATUS_SUCCESS)
DBG_PRT(MSG_LEVEL_DEBUG,
KERN_INFO"Download firmware...%d %zu\n", ii, fw->size);
if (NdisStatus != STATUS_SUCCESS)
+free_fw:
+ release_firmware(fw);
}
device_release_WPADEV(device);
}
device_release_WPADEV(device);
- release_firmware(device->firmware);
usb_set_intfdata(intf, NULL);
usb_put_dev(interface_to_usbdev(intf));
usb_set_intfdata(intf, NULL);
usb_put_dev(interface_to_usbdev(intf));