Skip to content

Commit

Permalink
V4L/DVB (6336): cx8802: Plug memory leak when unregistering a driver
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Trent Piepho authored and Mauro Carvalho Chehab committed Oct 22, 2007
1 parent 89a4794 commit a04036a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/media/video/cx88/cx88-mpeg.c
Original file line number Diff line number Diff line change
Expand Up @@ -735,6 +735,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);
Expand Down Expand Up @@ -817,6 +818,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);
}
}

Expand Down

0 comments on commit a04036a

Please sign in to comment.