]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
media: em28xx: Fix possible memory leak of em28xx struct
authorIgor Matheus Andrade Torrente <igormtorrente@gmail.com>
Tue, 4 May 2021 18:32:49 +0000 (20:32 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 20 Jul 2021 14:15:44 +0000 (16:15 +0200)
commitcd16b8a5536dfdd7f190592e7eee9c0a68743100
tree5b384fe9f36ba06ed02501c95219914ea8c63c16
parent9b808bdcc936be3503e5141879beb1cbd693d984
media: em28xx: Fix possible memory leak of em28xx struct

[ Upstream commit ac5688637144644f06ed1f3c6d4dd8bb7db96020 ]

The em28xx struct kref isn't being decreased after an error in the
em28xx_ir_init, leading to a possible memory leak.

A kref_put and em28xx_shutdown_buttons is added to the error handler code.

Signed-off-by: Igor Matheus Andrade Torrente <igormtorrente@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/usb/em28xx/em28xx-input.c