Re: [PATCH] net: sfp: fix memory leak in sfp_probe()

From: Jakub Kicinski
Date: Thu Jun 23 2022 - 15:34:25 EST


On Thu, 23 Jun 2022 15:09:14 +0800 Jianglei Nie wrote:
> sfp_probe() allocates a memory chunk from sfp with sfp_alloc(), when
> devm_add_action() fails, sfp is not freed, which leads to a memory leak.
>
> We should free the sfp with sfp_cleanup() when devm_add_action() fails.

.. and please add a Fixes tag