media: cx231xx-dvb: fix memory leak in dvb_fini()

In dvb_init(), dev->dvb is allocated by kzalloc.
Therefore, it must be freed being set to NULL.

Signed-off-by: Young Xiao <92siuyang@gmail.com>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
This commit is contained in:
Young Xiao 2019-05-28 08:38:13 -04:00 committed by Mauro Carvalho Chehab
parent 0547858b00
commit 6211e44a4d

View File

@ -1147,6 +1147,7 @@ static int dvb_fini(struct cx231xx *dev)
if (dev->dvb) {
unregister_dvb(dev->dvb);
kfree(dev->dvb);
dev->dvb = NULL;
}