Re: [PATCH v2] media: em28xx: Fix possible memory leak of em28xx struct

From: Hans Verkuil
Date: Thu May 06 2021 - 03:43:43 EST


On 05/05/2021 17:54, Shuah Khan wrote:
> On 5/4/21 2:32 PM, Igor Matheus Andrade Torrente wrote:
>> 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@xxxxxxxxx>
>> ---
>
> Hi Igor,
>
> Please look at Hans's response and comments to your v1 patch. v4l core
> addresses the lifetime issues now and this driver could be updated to
> use them instead if fixing the problems in this driver's resource
> lifetime mgmt code.

Actually, this patch is fine (I think, still need to review it). This is
related to the input part, not v4l2.

Regards,

Hans

>
> Please follow his review comments to address the issue based on his
> suggestions.
>
> thanks,
> -- Shuah
>