From 6211e44a4dfc2a12c5d40984ab876537bf0d0830 Mon Sep 17 00:00:00 2001 From: Young Xiao <92siuyang@gmail.com> Date: Tue, 28 May 2019 08:38:13 -0400 Subject: [PATCH] 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 Signed-off-by: Mauro Carvalho Chehab --- drivers/media/usb/cx231xx/cx231xx-dvb.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/media/usb/cx231xx/cx231xx-dvb.c b/drivers/media/usb/cx231xx/cx231xx-dvb.c index 8fbb9523c88d..e205f7f0a56a 100644 --- a/drivers/media/usb/cx231xx/cx231xx-dvb.c +++ b/drivers/media/usb/cx231xx/cx231xx-dvb.c @@ -1147,6 +1147,7 @@ static int dvb_fini(struct cx231xx *dev) if (dev->dvb) { unregister_dvb(dev->dvb); + kfree(dev->dvb); dev->dvb = NULL; }