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

From: Shuah Khan
Date: Wed May 05 2021 - 11:54:32 EST


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.

Please follow his review comments to address the issue based on his suggestions.

thanks,
-- Shuah