diff options
author | Mitesh Ahuja <mitesh.ahuja@emulex.com> | 2014-12-18 11:43:01 +0300 |
---|---|---|
committer | Roland Dreier <roland@purestorage.com> | 2015-02-18 19:31:03 +0300 |
commit | 4b8180aa5d13f87a42459a74518b7fb084312fe6 (patch) | |
tree | 98e96c07e34187d0fea09ceb62c7d95528563bcc /drivers/infiniband/hw/ocrdma/ocrdma_main.c | |
parent | 43c706b10a1054c0a73b2dc10374a946c8a3a17f (diff) | |
download | linux-4b8180aa5d13f87a42459a74518b7fb084312fe6.tar.xz |
RDMA/ocrdma: Host crash on destroying device resources
1. Cleanup sequence in ocrdma_remove(). The device should be
unregistered from IB stack before any device specific cleanup.
2. Always return success in the resource destroy path. In case destroy
command returns error, IB stack will trigger cleanup again while
closing the uverbs device causing kernel panic BUG_ON().
Signed-off-by: Selvin Xavier <selvin.xavier@emulex.com>
Signed-off-by: Mitesh Ahuja <mitesh.ahuja@emulex.com>
Signed-off-by: Devesh Sharma <devesh.sharma@emulex.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband/hw/ocrdma/ocrdma_main.c')
-rw-r--r-- | drivers/infiniband/hw/ocrdma/ocrdma_main.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_main.c b/drivers/infiniband/hw/ocrdma/ocrdma_main.c index edd81da55100..0083360d918e 100644 --- a/drivers/infiniband/hw/ocrdma/ocrdma_main.c +++ b/drivers/infiniband/hw/ocrdma/ocrdma_main.c @@ -530,11 +530,11 @@ static void ocrdma_remove(struct ocrdma_dev *dev) /* first unregister with stack to stop all the active traffic * of the registered clients. */ - ocrdma_rem_port_stats(dev); ocrdma_remove_sysfiles(dev); - ib_unregister_device(&dev->ibdev); + ocrdma_rem_port_stats(dev); + spin_lock(&ocrdma_devlist_lock); list_del_rcu(&dev->entry); spin_unlock(&ocrdma_devlist_lock); |