Commit 517a2813 authored by Hyunwoo Kim's avatar Hyunwoo Kim Committed by Mauro Carvalho Chehab

media: ttusb-dec: fix memory leak in ttusb_dec_exit_dvb()

Since dvb_frontend_detach() is not called in ttusb_dec_exit_dvb(),
which is called when the device is disconnected, dvb_frontend_free()
is not finally called.

This causes a memory leak just by repeatedly plugging and
unplugging the device.

Fix this issue by adding dvb_frontend_detach() to ttusb_dec_exit_dvb().

Link: https://lore.kernel.org/linux-media/20221117045925.14297-5-imv4bel@gmail.comSigned-off-by: default avatarHyunwoo Kim <imv4bel@gmail.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent a4315e5b
...@@ -1544,8 +1544,7 @@ static void ttusb_dec_exit_dvb(struct ttusb_dec *dec) ...@@ -1544,8 +1544,7 @@ static void ttusb_dec_exit_dvb(struct ttusb_dec *dec)
dvb_dmx_release(&dec->demux); dvb_dmx_release(&dec->demux);
if (dec->fe) { if (dec->fe) {
dvb_unregister_frontend(dec->fe); dvb_unregister_frontend(dec->fe);
if (dec->fe->ops.release) dvb_frontend_detach(dec->fe);
dec->fe->ops.release(dec->fe);
} }
dvb_unregister_adapter(&dec->adapter); dvb_unregister_adapter(&dec->adapter);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment