aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx88/cx88-mpeg.c
diff options
context:
space:
mode:
authorTrent Piepho <xyzzy@speakeasy.org>2007-10-05 10:28:09 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-10-22 10:01:43 -0400
commita04036a3129e09a9b9097de2b1f77dd82a6e9ac3 (patch)
treedfa0edc666f622bc5d3127d03ab943f0036d6bc3 /drivers/media/video/cx88/cx88-mpeg.c
parent89a47942f0facc4664d982005ac03d8dcb9635c1 (diff)
V4L/DVB (6336): cx8802: Plug memory leak when unregistering a driver
When a cx8802 sub-driver was unregistered, the struct cx8802_driver, which was kmalloc()ed by cx8802_register_driver(), was deleted from the list of drivers, but never freed. Signed-off-by: Trent Piepho <xyzzy@speakeasy.org> Reviewed-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/cx88/cx88-mpeg.c')
-rw-r--r--drivers/media/video/cx88/cx88-mpeg.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/media/video/cx88/cx88-mpeg.c b/drivers/media/video/cx88/cx88-mpeg.c
index d4858e4c3e27..448c67380945 100644
--- a/drivers/media/video/cx88/cx88-mpeg.c
+++ b/drivers/media/video/cx88/cx88-mpeg.c
@@ -735,6 +735,7 @@ int cx8802_unregister_driver(struct cx8802_driver *drv)
735 mutex_lock(&drv->core->lock); 735 mutex_lock(&drv->core->lock);
736 list_del(&d->drvlist); 736 list_del(&d->drvlist);
737 mutex_unlock(&drv->core->lock); 737 mutex_unlock(&drv->core->lock);
738 kfree(d);
738 } else 739 } else
739 printk(KERN_ERR "%s/2: cx8802 driver remove " 740 printk(KERN_ERR "%s/2: cx8802 driver remove "
740 "failed (%d)\n", dev->core->name, err); 741 "failed (%d)\n", dev->core->name, err);
@@ -817,6 +818,7 @@ static void __devexit cx8802_remove(struct pci_dev *pci_dev)
817 } else 818 } else
818 printk(KERN_ERR "%s/2: cx8802 driver remove " 819 printk(KERN_ERR "%s/2: cx8802 driver remove "
819 "failed (%d)\n", dev->core->name, err); 820 "failed (%d)\n", dev->core->name, err);
821 kfree(drv);
820 } 822 }
821 } 823 }
822 824