Message ID | 79137687d829899b0b1c9835fcb4b258004c439a.1725273354.git.leon@kernel.org (mailing list archive) |
---|---|
State | Accepted |
Headers | show |
Series | [rdma-next] IB/core: Fix ib_cache_setup_one error flow cleanup | expand |
On Mon, 02 Sep 2024 13:36:33 +0300, Leon Romanovsky wrote: > When ib_cache_update return an error, we exit ib_cache_setup_one > instantly with no proper cleanup, even though before this we had > already successfully done gid_table_setup_one, that results in > the kernel WARN below. > > Do proper cleanup using gid_table_cleanup_one before returning > the err in order to fix the issue. > > [...] Applied, thanks! [1/1] IB/core: Fix ib_cache_setup_one error flow cleanup https://git.kernel.org/rdma/rdma/c/1403c8b14765ea Best regards,
diff --git a/drivers/infiniband/core/cache.c b/drivers/infiniband/core/cache.c index 6791df64a5fe..b7c078b7f7cf 100644 --- a/drivers/infiniband/core/cache.c +++ b/drivers/infiniband/core/cache.c @@ -1640,8 +1640,10 @@ int ib_cache_setup_one(struct ib_device *device) rdma_for_each_port (device, p) { err = ib_cache_update(device, p, true, true, true); - if (err) + if (err) { + gid_table_cleanup_one(device); return err; + } } return 0;