[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <173460915277.348463.15529824823119564908.b4-ty@kernel.org>
Date: Thu, 19 Dec 2024 06:52:32 -0500
From: Leon Romanovsky <leon@...nel.org>
To: bvanassche@....org, jgg@...pe.ca, Ma Ke <make_ruc2021@....com>
Cc: linux-rdma@...r.kernel.org, linux-kernel@...r.kernel.org,
stable@...r.kernel.org
Subject: Re: [PATCH] RDMA/srp: Fix error handling in srp_add_port
On Tue, 17 Dec 2024 15:55:38 +0800, Ma Ke wrote:
> The reference count of the device incremented in device_initialize() is
> not decremented when device_add() fails. Add a put_device() call before
> returning from the function to decrement reference count for cleanup.
> Or it could cause memory leak.
>
> As comment of device_add() says, if device_add() succeeds, you should
> call device_del() when you want to get rid of it. If device_add() has
> not succeeded, use only put_device() to drop the reference count.
>
> [...]
Applied, thanks!
[1/1] RDMA/srp: Fix error handling in srp_add_port
https://git.kernel.org/rdma/rdma/c/a3cbf68c696111
Best regards,
--
Leon Romanovsky <leon@...nel.org>
Powered by blists - more mailing lists