diff options
author | Leon Romanovsky <leonro@mellanox.com> | 2018-05-29 14:56:16 +0300 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2018-06-01 11:16:23 -0400 |
commit | 2f5059a7af144426086555b62dd268d8060fe6d3 (patch) | |
tree | d78e898303a3cd79a67fa4513e8ef53897deed82 /drivers | |
parent | cd13a399e66c1b9b039064e8aa2f959eb90d6947 (diff) |
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')
-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); |