summaryrefslogtreecommitdiff
path: root/linux/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'linux/drivers')
-rw-r--r--linux/drivers/media/dvb/ttpci/av7110.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/linux/drivers/media/dvb/ttpci/av7110.c b/linux/drivers/media/dvb/ttpci/av7110.c
index 007130a6c..fbb8578ee 100644
--- a/linux/drivers/media/dvb/ttpci/av7110.c
+++ b/linux/drivers/media/dvb/ttpci/av7110.c
@@ -1321,20 +1321,27 @@ static int get_firmware(struct av7110* av7110)
" (error %i)\n", ret);
return -EINVAL;
}
+
if (fw->size <= 200000) {
printk("dvb-ttpci: this firmware is way too small.\n");
+ release_firmware(fw);
return -EINVAL;
}
+
/* check if the firmware is available */
av7110->bin_fw = (unsigned char*) vmalloc(fw->size);
if (NULL == av7110->bin_fw) {
DEB_D(("out of memory\n"));
+ release_firmware(fw);
return -ENOMEM;
}
+
memcpy(av7110->bin_fw, fw->data, fw->size);
av7110->size_fw = fw->size;
if ((ret = check_firmware(av7110)))
vfree(av7110->bin_fw);
+
+ release_firmware(fw);
return ret;
}
#endif