summaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorJesper Juhl <jj@chaosbits.net>2011-06-13 22:50:41 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2011-06-14 14:20:30 -0700
commit357f45db920393aac983a137bd74095f612d5a01 (patch)
tree55139bfad33a4c54b18e8dfa92cf08eda70c9926 /drivers/usb
parent869e9e567fe6bba859e1d761250d160a9216498a (diff)
downloadop-kernel-dev-357f45db920393aac983a137bd74095f612d5a01.zip
op-kernel-dev-357f45db920393aac983a137bd74095f612d5a01.tar.gz
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 <jj@chaosbits.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/serial/ti_usb_3410_5052.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c
index c6d92a5..ea84456 100644
--- a/drivers/usb/serial/ti_usb_3410_5052.c
+++ b/drivers/usb/serial/ti_usb_3410_5052.c
@@ -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;
}
OpenPOWER on IntegriCloud