struct device *dev = &usbduxsub->interface->dev;
int i = 0;
unsigned char *fp = (char *)firmwarePtr;
- unsigned char *firmwareBinary = NULL;
+ unsigned char *firmwareBinary;
int res = 0;
int maxAddr = 0;
j++;
if (j >= sizeof(buf)) {
dev_err(dev, "comedi_: bogus firmware file!\n");
+ kfree(firmwareBinary);
return -1;
}
}
if (buf[0] != ':') {
dev_err(dev, "comedi_: upload: not an ihex record: %s",
buf);
+ kfree(firmwareBinary);
return -EFAULT;
}
if (maxAddr >= FIRMWARE_MAX_LEN) {
dev_err(dev, "comedi_: firmware upload goes "
"beyond FX2 RAM boundaries.\n");
+ kfree(firmwareBinary);
return -EFAULT;
}
/* dev_dbg(dev, "comedi_: off=%x, len=%x:\n", off, len); */
if (type != 0) {
dev_err(dev, "comedi_: unsupported record type: %u\n",
type);
+ kfree(firmwareBinary);
return -EFAULT;
}
{
int i = 0;
unsigned char *fp = (char *)firmwarePtr;
- unsigned char *firmwareBinary = NULL;
+ unsigned char *firmwareBinary;
int res = 0;
int maxAddr = 0;
j++;
if (j >= sizeof(buf)) {
printk("comedi_: usbduxfast: bogus firmware file!\n");
+ kfree(firmwareBinary);
return -1;
}
}
if (buf[0] != ':') {
printk("comedi_: usbduxfast: upload: not an ihex record: %s", buf);
+ kfree(firmwareBinary);
return -EFAULT;
}
if (maxAddr >= FIRMWARE_MAX_LEN) {
printk("comedi_: usbduxfast: firmware upload goes beyond FX2 RAM boundaries.");
+ kfree(firmwareBinary);
return -EFAULT;
}
//printk("comedi_: usbduxfast: off=%x, len=%x:",off,len);
if (type != 0) {
printk("comedi_: usbduxfast: unsupported record type: %u\n", type);
+ kfree(firmwareBinary);
return -EFAULT;
}