linux-yocto/drivers/infiniband/ulp
Ma Ke 6ac1fac004 RDMA/srp: Fix error handling in srp_add_port
[ Upstream commit a3cbf68c69 ]

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.

Add a put_device() call before returning from the function to decrement
reference count for cleanup.

Found by code review.

Fixes: c8e4c23976 ("RDMA/srp: Rework the srp_add_port() error path")
Signed-off-by: Ma Ke <make_ruc2021@163.com>
Link: https://patch.msgid.link/20241217075538.2909996-1-make_ruc2021@163.com
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-02-21 13:49:12 +01:00
..
ipoib RDMA/IPoIB: Fix format truncation compilation errors 2024-06-12 11:03:31 +02:00
iser IB/iser: Prevent invalidating wrong MR 2024-01-25 15:27:38 -08:00
isert
opa_vnic
rtrs RDMA/rtrs: Ensure 'ib_sge list' is accessible 2025-01-09 13:30:02 +01:00
srp RDMA/srp: Fix error handling in srp_add_port 2025-02-21 13:49:12 +01:00
srpt RDMA/srpt: Make slab cache names unique 2024-11-01 01:55:58 +01:00
Makefile