diff mbox

[rdma-next,1/2] IB/rxe: Fix rxe dev insertion to rxe_dev_list

Message ID 20170119132559.23999-1-leon@kernel.org (mailing list archive)
State Accepted
Headers show

Commit Message

Leon Romanovsky Jan. 19, 2017, 1:25 p.m. UTC
From: Maor Gottlieb <maorg@mellanox.com>

The first argument of list_add_tail is the new item and the second
is the head of the list. Fix the code to pass arguments in the
right order, otherwise not all the rxe devices will be removed
during teardown.

Fixes: 8700e3e7c4857 ('Soft RoCE driver')
Signed-off-by: Maor Gottlieb <maorg@mellanox.com>
Reviewed-by: Moni Shoua <monis@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
---
 drivers/infiniband/sw/rxe/rxe_net.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Doug Ledford Jan. 24, 2017, 9:18 p.m. UTC | #1
On Thu, 2017-01-19 at 15:25 +0200, Leon Romanovsky wrote:
> From: Maor Gottlieb <maorg@mellanox.com>
> 
> The first argument of list_add_tail is the new item and the second
> is the head of the list. Fix the code to pass arguments in the
> right order, otherwise not all the rxe devices will be removed
> during teardown.
> 
> Fixes: 8700e3e7c4857 ('Soft RoCE driver')
> Signed-off-by: Maor Gottlieb <maorg@mellanox.com>
> Reviewed-by: Moni Shoua <monis@mellanox.com>
> Signed-off-by: Leon Romanovsky <leon@kernel.org>

Thanks, added to -rc.
diff mbox

Patch

diff --git a/drivers/infiniband/sw/rxe/rxe_net.c b/drivers/infiniband/sw/rxe/rxe_net.c
index 342e781..4abdeb3 100644
--- a/drivers/infiniband/sw/rxe/rxe_net.c
+++ b/drivers/infiniband/sw/rxe/rxe_net.c
@@ -555,7 +555,7 @@  struct rxe_dev *rxe_net_add(struct net_device *ndev)
 	}
 
 	spin_lock_bh(&dev_list_lock);
-	list_add_tail(&rxe_dev_list, &rxe->list);
+	list_add_tail(&rxe->list, &rxe_dev_list);
 	spin_unlock_bh(&dev_list_lock);
 	return rxe;
 }