From f4a94062511dd119d6ae332cf5967f9eb1316ae1 Mon Sep 17 00:00:00 2001 From: Michael Hunold Date: Mon, 21 Jun 2004 18:53:27 +0000 Subject: =?UTF-8?q?-=20don't=20forget=20to=20call=20release=5Ffirmware(),?= =?UTF-8?q?=20thanks=20to=20Kenneth=20Aafl=C3=B8y=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- linux/drivers/media/dvb/ttpci/av7110.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'linux') 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 -- cgit v1.2.3