diff options
author | Leon Romanovsky <leonro@mellanox.com> | 2018-05-29 13:56:16 +0200 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2018-06-01 17:16:23 +0200 |
commit | 2f5059a7af144426086555b62dd268d8060fe6d3 (patch) | |
tree | d78e898303a3cd79a67fa4513e8ef53897deed82 /drivers/infiniband | |
parent | RDMA/cxgb3: Don't crash kernel just because IDR is full (diff) | |
download | linux-2f5059a7af144426086555b62dd268d8060fe6d3.tar.xz linux-2f5059a7af144426086555b62dd268d8060fe6d3.zip |
RDMA/cm: Abort loop in case of CM dequeue
In case CM work list is empty, the work pointer will be NULL,
so instead of kernel crash it is better to abort processing
of works.
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/core/cm.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c index 7df4c7173607..724f123c037f 100644 --- a/drivers/infiniband/core/cm.c +++ b/drivers/infiniband/core/cm.c @@ -1707,7 +1707,9 @@ static void cm_process_work(struct cm_id_private *cm_id_priv, spin_lock_irq(&cm_id_priv->lock); work = cm_dequeue_work(cm_id_priv); spin_unlock_irq(&cm_id_priv->lock); - BUG_ON(!work); + if (!work) + return; + ret = cm_id_priv->id.cm_handler(&cm_id_priv->id, &work->cm_event); cm_free_work(work); |