media: ttusb-dec: fix memory leak in ttusb_dec_exit_dvb()
authorHyunwoo Kim <imv4bel@gmail.com>
Thu, 17 Nov 2022 04:59:25 +0000 (04:59 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 9 Jun 2023 08:34:12 +0000 (10:34 +0200)
commitea2938c27b0212aaab6702c16b7385e073b35643
tree61e30d6732138ecfc3798c30ec1ffea8884d386b
parentdd68399361151aea127d14d03a2951ae19b825f5
media: ttusb-dec: fix memory leak in ttusb_dec_exit_dvb()

[ Upstream commit 517a281338322ff8293f988771c98aaa7205e457 ]

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.com
Signed-off-by: Hyunwoo Kim <imv4bel@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/usb/ttusb-dec/ttusb_dec.c