Skip to content

Commit 357f45d

Browse files
jjuhlgregkh
authored andcommitted
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]>
1 parent 869e9e5 commit 357f45d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/usb/serial/ti_usb_3410_5052.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1745,6 +1745,7 @@ static int ti_download_firmware(struct ti_device *tdev)
17451745
}
17461746
if (fw_p->size > TI_FIRMWARE_BUF_SIZE) {
17471747
dev_err(&dev->dev, "%s - firmware too large %zu\n", __func__, fw_p->size);
1748+
release_firmware(fw_p);
17481749
return -ENOENT;
17491750
}
17501751

0 commit comments

Comments
 (0)