Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 141352
b: refs/heads/master
c: b171041
h: refs/heads/master
v: v3
  • Loading branch information
Julia Lawall authored and Greg Kroah-Hartman committed Apr 3, 2009
1 parent 5908dbe commit 6d84e66
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fc0cb7d166f3c8a318d8b0c9580cfe12fed9234c
refs/heads/master: b171041be02f171cd06712746b97a996f883ec10
6 changes: 5 additions & 1 deletion trunk/drivers/staging/comedi/drivers/usbdux.c
Original file line number Diff line number Diff line change
Expand Up @@ -2298,7 +2298,7 @@ static int read_firmware(struct usbduxsub *usbduxsub, void *firmwarePtr,
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;

Expand All @@ -2322,6 +2322,7 @@ static int read_firmware(struct usbduxsub *usbduxsub, void *firmwarePtr,
j++;
if (j >= sizeof(buf)) {
dev_err(dev, "comedi_: bogus firmware file!\n");
kfree(firmwareBinary);
return -1;
}
}
Expand All @@ -2344,6 +2345,7 @@ static int read_firmware(struct usbduxsub *usbduxsub, void *firmwarePtr,
if (buf[0] != ':') {
dev_err(dev, "comedi_: upload: not an ihex record: %s",
buf);
kfree(firmwareBinary);
return -EFAULT;
}

Expand All @@ -2360,6 +2362,7 @@ static int read_firmware(struct usbduxsub *usbduxsub, void *firmwarePtr,
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); */
Expand All @@ -2375,6 +2378,7 @@ static int read_firmware(struct usbduxsub *usbduxsub, void *firmwarePtr,
if (type != 0) {
dev_err(dev, "comedi_: unsupported record type: %u\n",
type);
kfree(firmwareBinary);
return -EFAULT;
}

Expand Down
6 changes: 5 additions & 1 deletion trunk/drivers/staging/comedi/drivers/usbduxfast.c
Original file line number Diff line number Diff line change
Expand Up @@ -1298,7 +1298,7 @@ static int read_firmware(usbduxfastsub_t * usbduxfastsub, void *firmwarePtr,
{
int i = 0;
unsigned char *fp = (char *)firmwarePtr;
unsigned char *firmwareBinary = NULL;
unsigned char *firmwareBinary;
int res = 0;
int maxAddr = 0;

Expand All @@ -1322,6 +1322,7 @@ static int read_firmware(usbduxfastsub_t * usbduxfastsub, void *firmwarePtr,
j++;
if (j >= sizeof(buf)) {
printk("comedi_: usbduxfast: bogus firmware file!\n");
kfree(firmwareBinary);
return -1;
}
}
Expand All @@ -1340,6 +1341,7 @@ static int read_firmware(usbduxfastsub_t * usbduxfastsub, void *firmwarePtr,

if (buf[0] != ':') {
printk("comedi_: usbduxfast: upload: not an ihex record: %s", buf);
kfree(firmwareBinary);
return -EFAULT;
}

Expand All @@ -1355,6 +1357,7 @@ static int read_firmware(usbduxfastsub_t * usbduxfastsub, void *firmwarePtr,

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);
Expand All @@ -1369,6 +1372,7 @@ static int read_firmware(usbduxfastsub_t * usbduxfastsub, void *firmwarePtr,

if (type != 0) {
printk("comedi_: usbduxfast: unsupported record type: %u\n", type);
kfree(firmwareBinary);
return -EFAULT;
}

Expand Down

0 comments on commit 6d84e66

Please sign in to comment.