OSDN Git Service

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)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Wed, 2 Jun 2021 11:04:31 +0000 (13:04 +0200)
commitac5688637144644f06ed1f3c6d4dd8bb7db96020
treed7a5695a1bedaf4de26bcff2141f6738d418e02b
parenta3a54bf4bddaecda8b5767209cfc703f0be2841d
media: em28xx: Fix possible memory leak of em28xx struct

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>
drivers/media/usb/em28xx/em28xx-input.c