Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a04036a3 authored by Trent Piepho's avatar Trent Piepho Committed by Mauro Carvalho Chehab
Browse files

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: default avatarTrent Piepho <xyzzy@speakeasy.org>
Reviewed-by: default avatarMichael Krufky <mkrufky@linuxtv.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent 89a47942
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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);
@@ -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);
		}
	}