mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
USB: TI 3410/5052 USB Serial Driver: Fix mem leak when firmware is too 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 <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
869e9e567f
commit
357f45db92
1 changed files with 1 additions and 0 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue