summaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorPatrick Boettcher <pb@linuxtv.org>2006-05-14 13:29:48 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-06-25 02:00:33 -0300
commit976e3483799ce5f718753d67454378d46500f0da (patch)
tree5cea343af1ad3fb802bfef632422c82ac06c09a1 /drivers/media
parent9bbe076f364aa7ba8c2e49e417a76d628ffb164c (diff)
downloadkernel-crypto-976e3483799ce5f718753d67454378d46500f0da.tar.gz
kernel-crypto-976e3483799ce5f718753d67454378d46500f0da.tar.xz
kernel-crypto-976e3483799ce5f718753d67454378d46500f0da.zip
V4L/DVB (4030): Minor code cleanup on the genpix-module
Minor code cleanup on the genpix-module. Signed-off-by: Patrick Boettcher <pb@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/dvb/dvb-usb/gp8psk.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/drivers/media/dvb/dvb-usb/gp8psk.c b/drivers/media/dvb/dvb-usb/gp8psk.c
index d6771cbd262..9a98f3fdae3 100644
--- a/drivers/media/dvb/dvb-usb/gp8psk.c
+++ b/drivers/media/dvb/dvb-usb/gp8psk.c
@@ -92,36 +92,38 @@ static int gp8psk_load_bcm4500fw(struct dvb_usb_device *d)
return ret;
}
- if (gp8psk_usb_out_op(d, LOAD_BCM4500,1,0,NULL, 0)) {
- release_firmware(fw);
- return -EINVAL;
- }
+ ret = -EINVAL;
+
+ if (gp8psk_usb_out_op(d, LOAD_BCM4500,1,0,NULL, 0))
+ goto out_rel_fw;
info("downloaidng bcm4500 firmware from file '%s'",bcm4500_firmware);
ptr = fw->data;
- buf = (u8 *) kmalloc(512, GFP_KERNEL | GFP_DMA);
+ buf = kmalloc(512, GFP_KERNEL | GFP_DMA);
while (ptr[0] != 0xff) {
u16 buflen = ptr[0] + 4;
if (ptr + buflen >= fw->data + fw->size) {
err("failed to load bcm4500 firmware.");
- release_firmware(fw);
- kfree(buf);
- return -EINVAL;
+ goto out_free;
}
memcpy(buf, ptr, buflen);
if (dvb_usb_generic_write(d, buf, buflen)) {
err("failed to load bcm4500 firmware.");
- release_firmware(fw);
- kfree(buf);
- return -EIO;
+ goto out_free;
}
ptr += buflen;
}
- release_firmware(fw);
+
+ ret = 0;
+
+out_free:
kfree(buf);
- return 0;
+out_rel_fw:
+ release_firmware(fw);
+
+ return ret;
}
static int gp8psk_power_ctrl(struct dvb_usb_device *d, int onoff)