Messages in this thread Patch in this message | | | From | Young Xiao <> | Subject | [PATCH] cx231xx-dvb: fix memory leak in dvb_fini() | Date | Tue, 28 May 2019 20:38:13 +0800 |
| |
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> --- 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 89357cb..89839c7 100644 --- a/drivers/media/usb/cx231xx/cx231xx-dvb.c +++ b/drivers/media/usb/cx231xx/cx231xx-dvb.c @@ -1159,6 +1159,7 @@ static int dvb_fini(struct cx231xx *dev) if (dev->dvb) { unregister_dvb(dev->dvb); + kfree(dev->dvb); dev->dvb = NULL; } -- 2.7.4
| |