[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20220920154856.4s675wv7koivvpgb@mercury.elektranox.org>
Date: Tue, 20 Sep 2022 17:48:56 +0200
From: Sebastian Reichel <sebastian.reichel@...labora.com>
To: Jianglei Nie <niejianglei2021@....com>
Cc: kuba@...nel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] HSI: ssi_protocol: fix potential resource leak in
ssip_pn_open()
Hi,
On Mon, Sep 05, 2022 at 03:48:01PM +0800, Jianglei Nie wrote:
> ssip_pn_open() claims the HSI client's port with hsi_claim_port(). When
> hsi_register_port_event() gets some error and returns a negetive value,
> the HSI client's port should be released with hsi_release_port().
>
> Fix it by calling hsi_release_port() when hsi_register_port_event() fails.
>
> Signed-off-by: Jianglei Nie <niejianglei2021@....com>
> ---
> drivers/hsi/clients/ssi_protocol.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/hsi/clients/ssi_protocol.c b/drivers/hsi/clients/ssi_protocol.c
> index 21f11a5b965b..49ffd808d17f 100644
> --- a/drivers/hsi/clients/ssi_protocol.c
> +++ b/drivers/hsi/clients/ssi_protocol.c
> @@ -931,6 +931,7 @@ static int ssip_pn_open(struct net_device *dev)
> if (err < 0) {
> dev_err(&cl->device, "Register HSI port event failed (%d)\n",
> err);
> + hsi_release_port(cl);
> return err;
> }
> dev_dbg(&cl->device, "Configuring SSI port\n");
Thanks, queued.
-- Sebastian
Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)
Powered by blists - more mailing lists