aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexey Klimov <klimov.linux@gmail.com>2009-03-31 20:01:04 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-04-06 20:44:32 -0400
commit81d1d09f926394c19a19ceeb139462908ac63a01 (patch)
tree82840fd1e9b61c39ec78598e12d47cb9d778fe84
parentb7732a32af3335454fd274d1b09375416336b5b1 (diff)
V4L/DVB (11393): radio-si470x: fix possible bug with freeing memory order
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>
-rw-r--r--drivers/media/radio/radio-si470x.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/media/radio/radio-si470x.c b/drivers/media/radio/radio-si470x.c
index 713e242ba8b2..92c297796a9f 100644
--- a/drivers/media/radio/radio-si470x.c
+++ b/drivers/media/radio/radio-si470x.c
@@ -1686,7 +1686,7 @@ static int si470x_usb_driver_probe(struct usb_interface *intf,
1686 /* show some infos about the specific si470x device */ 1686 /* show some infos about the specific si470x device */
1687 if (si470x_get_all_registers(radio) < 0) { 1687 if (si470x_get_all_registers(radio) < 0) {
1688 retval = -EIO; 1688 retval = -EIO;
1689 goto err_all; 1689 goto err_video;
1690 } 1690 }
1691 printk(KERN_INFO DRIVER_NAME ": DeviceID=0x%4.4hx ChipID=0x%4.4hx\n", 1691 printk(KERN_INFO DRIVER_NAME ": DeviceID=0x%4.4hx ChipID=0x%4.4hx\n",
1692 radio->registers[DEVICEID], radio->registers[CHIPID]); 1692 radio->registers[DEVICEID], radio->registers[CHIPID]);
@@ -1694,7 +1694,7 @@ static int si470x_usb_driver_probe(struct usb_interface *intf,
1694 /* get software and hardware versions */ 1694 /* get software and hardware versions */
1695 if (si470x_get_scratch_page_versions(radio) < 0) { 1695 if (si470x_get_scratch_page_versions(radio) < 0) {
1696 retval = -EIO; 1696 retval = -EIO;
1697 goto err_all; 1697 goto err_video;
1698 } 1698 }
1699 printk(KERN_INFO DRIVER_NAME 1699 printk(KERN_INFO DRIVER_NAME
1700 ": software version %d, hardware version %d\n", 1700 ": software version %d, hardware version %d\n",
@@ -1727,7 +1727,7 @@ static int si470x_usb_driver_probe(struct usb_interface *intf,
1727 radio->buffer = kmalloc(radio->buf_size, GFP_KERNEL); 1727 radio->buffer = kmalloc(radio->buf_size, GFP_KERNEL);
1728 if (!radio->buffer) { 1728 if (!radio->buffer) {
1729 retval = -EIO; 1729 retval = -EIO;
1730 goto err_all; 1730 goto err_video;
1731 } 1731 }
1732 1732
1733 /* rds buffer configuration */ 1733 /* rds buffer configuration */
@@ -1749,8 +1749,9 @@ static int si470x_usb_driver_probe(struct usb_interface *intf,
1749 1749
1750 return 0; 1750 return 0;
1751err_all: 1751err_all:
1752 video_device_release(radio->videodev);
1753 kfree(radio->buffer); 1752 kfree(radio->buffer);
1753err_video:
1754 video_device_release(radio->videodev);
1754err_radio: 1755err_radio:
1755 kfree(radio); 1756 kfree(radio);
1756err_initial: 1757err_initial: