summaryrefslogtreecommitdiff
path: root/linux/drivers
diff options
context:
space:
mode:
authorTrent Piepho <xyzzy@speakeasy.org>2007-10-05 07:28:09 -0700
committerTrent Piepho <xyzzy@speakeasy.org>2007-10-05 07:28:09 -0700
commit7f367712814cef0e1e132c2c39363cb0c6adb557 (patch)
treebfb855dc1948da104892c11916e01cf0da74e68d /linux/drivers
parent73d8a897cbf675d80f30d15f981ea23c16d3b900 (diff)
downloadmediapointer-dvb-s2-7f367712814cef0e1e132c2c39363cb0c6adb557.tar.gz
mediapointer-dvb-s2-7f367712814cef0e1e132c2c39363cb0c6adb557.tar.bz2
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>
Diffstat (limited to 'linux/drivers')
-rw-r--r--linux/drivers/media/video/cx88/cx88-mpeg.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/linux/drivers/media/video/cx88/cx88-mpeg.c b/linux/drivers/media/video/cx88/cx88-mpeg.c
index c4f5b8dab..339992afd 100644
--- a/linux/drivers/media/video/cx88/cx88-mpeg.c
+++ b/linux/drivers/media/video/cx88/cx88-mpeg.c
@@ -793,6 +793,7 @@ int cx8802_unregister_driver(struct cx8802_driver *drv)
mutex_lock(&drv->core->lock);
list_del(&d->drvlist);
mutex_unlock(&drv->core->lock);
+ kfree(d);
} else
printk(KERN_ERR "%s/2: cx8802 driver remove "
"failed (%d)\n", dev->core->name, err);
@@ -875,6 +876,7 @@ static void __devexit cx8802_remove(struct pci_dev *pci_dev)
} else
printk(KERN_ERR "%s/2: cx8802 driver remove "
"failed (%d)\n", dev->core->name, err);
+ kfree(drv);
}
}