Re: [PATCH] nfc: fix memory leak of se_io context in nfc_genl_se_io

Fedor Pchelkin
2023-03-04T16:44:53Z

On Mon, Feb 27, 2023 at 11:23:59AM -0800, Jakub Kicinski wrote:
> FWIW this patch has already been applied, please send the next changes
> on top:
> https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/commit/?id=25ff6f8a5a3b8dc48e8abda6f013e8cc4b14ffea

Okay.

On Mon, Feb 27, 2023 at 11:08:54AM +0100, Krzysztof Kozlowski wrote:
> kfree could be after device_unlock. Although se_io() will free it with
> lock held, but error paths usually unwind everything in reverse order
> LIFO, so first unlock then kfree.

Then, based on our dicsussion with Krzysztof, I'll send the patch
adjusting the order in the error path.