mirror-linux/drivers/infiniband/ulp
Ma Ke a3cbf68c69 RDMA/srp: Fix error handling in srp_add_port
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>
2024-12-19 06:50:36 -05:00
..
ipoib RDMA: Use ethtool string helpers 2024-10-30 11:28:57 +02:00
iser IB/iser: Remove unused declaration in header file 2024-09-10 16:41:03 +03:00
isert IB/isert: remove the handling of last WQE reached event 2024-06-26 10:53:29 -03:00
opa_vnic RDMA: Use ethtool string helpers 2024-10-30 11:28:57 +02:00
rtrs RDMA/rtrs-clt: Remove an extra space 2024-08-28 15:24:35 +03:00
srp RDMA/srp: Fix error handling in srp_add_port 2024-12-19 06:50:36 -05:00
srpt RDMA/srpt: Make slab cache names unique 2024-10-11 14:07:33 -03:00
Makefile