The patch number 9499 was added via [EMAIL PROTECTED]
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
        [EMAIL PROTECTED]

------

From: Darron Broad  <[EMAIL PROTECTED]>
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).

Priority: normal

Signed-off-by: Darron Broad <[EMAIL PROTECTED]>


---

 linux/drivers/media/video/cx88/cx88-mpeg.c |   28 +++++++++++----------
 1 file changed, 15 insertions(+), 13 deletions(-)

diff -r 50e4cdc46320 -r a4bf3a83d4ed linux/drivers/media/video/cx88/cx88-mpeg.c
--- a/linux/drivers/media/video/cx88/cx88-mpeg.c        Thu Oct 30 15:28:19 
2008 -0200
+++ b/linux/drivers/media/video/cx88/cx88-mpeg.c        Thu Oct 30 08:05:23 
2008 +0000
@@ -809,10 +809,6 @@ static int __devinit cx8802_probe(struct
        struct cx8802_dev *dev;
        struct cx88_core  *core;
        int err;
-#if defined(CONFIG_VIDEO_CX88_DVB) || defined(CONFIG_VIDEO_CX88_DVB_MODULE)
-       struct videobuf_dvb_frontend *demod;
-       int i;
-#endif
 
        /* general setup */
        core = cx88_core_get(pci_dev);
@@ -843,15 +839,21 @@ static int __devinit cx8802_probe(struct
        mutex_init(&dev->frontends.lock);
        INIT_LIST_HEAD(&dev->frontends.felist);
 
-       if (core->board.num_frontends)
-               printk(KERN_INFO "%s() allocating %d frontend(s)\n", __func__, 
core->board.num_frontends);
-
-       for (i = 1; i <= core->board.num_frontends; i++) {
-               demod = videobuf_dvb_alloc_frontend(&dev->frontends, i);
-               if(demod == NULL) {
-                       printk(KERN_ERR "%s() failed to alloc\n", __func__);
-                       err = -ENOMEM;
-                       goto fail_free;
+       if (core->board.num_frontends) {
+               struct videobuf_dvb_frontend *fe;
+               int i;
+
+               printk(KERN_INFO "%s() allocating %d frontend(s)\n", __func__,
+                       core->board.num_frontends);
+               for (i = 1; i <= core->board.num_frontends; i++) {
+                       fe = videobuf_dvb_alloc_frontend(&dev->frontends, i);
+                       if(fe == NULL) {
+                               printk(KERN_ERR "%s() failed to alloc\n",
+                                       __func__);
+                               videobuf_dvb_dealloc_frontends(&dev->frontends);
+                               err = -ENOMEM;
+                               goto fail_free;
+                       }
                }
        }
 #endif


---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/a4bf3a83d4ed91b15afd25912749f1dab6879922

_______________________________________________
linuxtv-commits mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to