Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 357f45db authored by Jesper Juhl's avatar Jesper Juhl Committed by Greg Kroah-Hartman
Browse files

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: default avatarJesper Juhl <jj@chaosbits.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 869e9e56
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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;
	}