diff options
-rw-r--r-- | drivers/infiniband/core/cma.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c index d10fdf1419b1..3982b81d33cf 100644 --- a/drivers/infiniband/core/cma.c +++ b/drivers/infiniband/core/cma.c | |||
@@ -2151,12 +2151,9 @@ static int cma_remove_id_dev(struct rdma_id_private *id_priv) | |||
2151 | 2151 | ||
2152 | static void cma_process_remove(struct cma_device *cma_dev) | 2152 | static void cma_process_remove(struct cma_device *cma_dev) |
2153 | { | 2153 | { |
2154 | struct list_head remove_list; | ||
2155 | struct rdma_id_private *id_priv; | 2154 | struct rdma_id_private *id_priv; |
2156 | int ret; | 2155 | int ret; |
2157 | 2156 | ||
2158 | INIT_LIST_HEAD(&remove_list); | ||
2159 | |||
2160 | mutex_lock(&lock); | 2157 | mutex_lock(&lock); |
2161 | while (!list_empty(&cma_dev->id_list)) { | 2158 | while (!list_empty(&cma_dev->id_list)) { |
2162 | id_priv = list_entry(cma_dev->id_list.next, | 2159 | id_priv = list_entry(cma_dev->id_list.next, |
@@ -2167,8 +2164,7 @@ static void cma_process_remove(struct cma_device *cma_dev) | |||
2167 | continue; | 2164 | continue; |
2168 | } | 2165 | } |
2169 | 2166 | ||
2170 | list_del(&id_priv->list); | 2167 | list_del_init(&id_priv->list); |
2171 | list_add_tail(&id_priv->list, &remove_list); | ||
2172 | atomic_inc(&id_priv->refcount); | 2168 | atomic_inc(&id_priv->refcount); |
2173 | mutex_unlock(&lock); | 2169 | mutex_unlock(&lock); |
2174 | 2170 | ||