summaryrefslogtreecommitdiff
path: root/linux/drivers/media
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2009-04-01 00:01:04 +0000
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-04-01 00:01:04 +0000
commita1e46dd7960d90441d7adeb6109ca7426c2e728e (patch)
tree233ca7568bf5fbd8bdaad7e1957313c61b625a76 /linux/drivers/media
parent8dd3ceb79cec4a833fbc9fd654b7e71e9548d331 (diff)
downloadmediapointer-dvb-s2-a1e46dd7960d90441d7adeb6109ca7426c2e728e.tar.gz
mediapointer-dvb-s2-a1e46dd7960d90441d7adeb6109ca7426c2e728e.tar.bz2
radio-si470x: fix possible bug with freeing memory order
From: Alexey Klimov <klimov.linux@gmail.com> Patch fixes cleanup procedure in si470x_usb_driver_probe. Add new label err_video and change order of freeing memory. Signed-off-by: Alexey Klimov <klimov.linux@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'linux/drivers/media')
-rw-r--r--linux/drivers/media/radio/radio-si470x.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/linux/drivers/media/radio/radio-si470x.c b/linux/drivers/media/radio/radio-si470x.c
index 599fc0dcf..b4d6641b4 100644
--- a/linux/drivers/media/radio/radio-si470x.c
+++ b/linux/drivers/media/radio/radio-si470x.c
@@ -1687,7 +1687,7 @@ static int si470x_usb_driver_probe(struct usb_interface *intf,
/* show some infos about the specific si470x device */
if (si470x_get_all_registers(radio) < 0) {
retval = -EIO;
- goto err_all;
+ goto err_video;
}
printk(KERN_INFO DRIVER_NAME ": DeviceID=0x%4.4hx ChipID=0x%4.4hx\n",
radio->registers[DEVICEID], radio->registers[CHIPID]);
@@ -1695,7 +1695,7 @@ static int si470x_usb_driver_probe(struct usb_interface *intf,
/* get software and hardware versions */
if (si470x_get_scratch_page_versions(radio) < 0) {
retval = -EIO;
- goto err_all;
+ goto err_video;
}
printk(KERN_INFO DRIVER_NAME
": software version %d, hardware version %d\n",
@@ -1728,7 +1728,7 @@ static int si470x_usb_driver_probe(struct usb_interface *intf,
radio->buffer = kmalloc(radio->buf_size, GFP_KERNEL);
if (!radio->buffer) {
retval = -EIO;
- goto err_all;
+ goto err_video;
}
/* rds buffer configuration */
@@ -1750,8 +1750,9 @@ static int si470x_usb_driver_probe(struct usb_interface *intf,
return 0;
err_all:
- video_device_release(radio->videodev);
kfree(radio->buffer);
+err_video:
+ video_device_release(radio->videodev);
err_radio:
kfree(radio);
err_initial: