diff options
author | Darron Broad <darron@kewl.org> | 2008-10-30 04:05:23 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-11-11 05:11:27 -0500 |
commit | 1a8dc86db1546f60a25f2b5cd071c0091db87146 (patch) | |
tree | 66cb33b1192bb9ede8aa35cd008f41896dc65670 /drivers | |
parent | 9c8e0a260ed7c8935d7ee8dd51cd1971ef516385 (diff) |
V4L/DVB (9499): cx88-mpeg: final fix for analogue only compilation + de-alloc fix
Final fix for when analogue only is selected
for compilation (ie, !CX88_DVB)
This tidies up previous fix and adds missing
de-alloc memory leak on fault (eg, if fe1 fails to alloc
where fe0 was allocated).
Signed-off-by: Darron Broad <darron@kewl.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/video/cx88/cx88-mpeg.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/drivers/media/video/cx88/cx88-mpeg.c b/drivers/media/video/cx88/cx88-mpeg.c index a1c435b4b1cd..3ebdcd1d83f8 100644 --- a/drivers/media/video/cx88/cx88-mpeg.c +++ b/drivers/media/video/cx88/cx88-mpeg.c | |||
@@ -769,10 +769,6 @@ static int __devinit cx8802_probe(struct pci_dev *pci_dev, | |||
769 | struct cx8802_dev *dev; | 769 | struct cx8802_dev *dev; |
770 | struct cx88_core *core; | 770 | struct cx88_core *core; |
771 | int err; | 771 | int err; |
772 | #if defined(CONFIG_VIDEO_CX88_DVB) || defined(CONFIG_VIDEO_CX88_DVB_MODULE) | ||
773 | struct videobuf_dvb_frontend *demod; | ||
774 | int i; | ||
775 | #endif | ||
776 | 772 | ||
777 | /* general setup */ | 773 | /* general setup */ |
778 | core = cx88_core_get(pci_dev); | 774 | core = cx88_core_get(pci_dev); |
@@ -803,15 +799,21 @@ static int __devinit cx8802_probe(struct pci_dev *pci_dev, | |||
803 | mutex_init(&dev->frontends.lock); | 799 | mutex_init(&dev->frontends.lock); |
804 | INIT_LIST_HEAD(&dev->frontends.felist); | 800 | INIT_LIST_HEAD(&dev->frontends.felist); |
805 | 801 | ||
806 | if (core->board.num_frontends) | 802 | if (core->board.num_frontends) { |
807 | printk(KERN_INFO "%s() allocating %d frontend(s)\n", __func__, core->board.num_frontends); | 803 | struct videobuf_dvb_frontend *fe; |
808 | 804 | int i; | |
809 | for (i = 1; i <= core->board.num_frontends; i++) { | 805 | |
810 | demod = videobuf_dvb_alloc_frontend(&dev->frontends, i); | 806 | printk(KERN_INFO "%s() allocating %d frontend(s)\n", __func__, |
811 | if(demod == NULL) { | 807 | core->board.num_frontends); |
812 | printk(KERN_ERR "%s() failed to alloc\n", __func__); | 808 | for (i = 1; i <= core->board.num_frontends; i++) { |
813 | err = -ENOMEM; | 809 | fe = videobuf_dvb_alloc_frontend(&dev->frontends, i); |
814 | goto fail_free; | 810 | if(fe == NULL) { |
811 | printk(KERN_ERR "%s() failed to alloc\n", | ||
812 | __func__); | ||
813 | videobuf_dvb_dealloc_frontends(&dev->frontends); | ||
814 | err = -ENOMEM; | ||
815 | goto fail_free; | ||
816 | } | ||
815 | } | 817 | } |
816 | } | 818 | } |
817 | #endif | 819 | #endif |