Skip to content

Commit

Permalink
USB: TI 3410/5052 USB Serial Driver: Fix mem leak when firmware is to…
Browse files Browse the repository at this point in the history
…o big.

If the size of the firmware exceeds TI_FIRMWARE_BUF_SIZE we'll leak 'fw_p'
by failing to call release_firmware().
This patch fixes the leak.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Jesper Juhl authored and Greg Kroah-Hartman committed Jun 14, 2011
1 parent 869e9e5 commit 357f45d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/usb/serial/ti_usb_3410_5052.c
Original file line number Diff line number Diff line change
Expand Up @@ -1745,6 +1745,7 @@ static int ti_download_firmware(struct ti_device *tdev)
}
if (fw_p->size > TI_FIRMWARE_BUF_SIZE) {
dev_err(&dev->dev, "%s - firmware too large %zu\n", __func__, fw_p->size);
release_firmware(fw_p);
return -ENOENT;
}

Expand Down

0 comments on commit 357f45d

Please sign in to comment.