Commit 50b19729 authored by Dan Carpenter's avatar Dan Carpenter Committed by Doug Ledford

IB/hfi1: checking for NULL instead of IS_ERR

__get_txreq() returns an ERR_PTR() but this checks for NULL so it would
oops on failure.
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent aeef010a
...@@ -749,11 +749,13 @@ static inline struct verbs_txreq *get_txreq(struct hfi1_ibdev *dev, ...@@ -749,11 +749,13 @@ static inline struct verbs_txreq *get_txreq(struct hfi1_ibdev *dev,
struct verbs_txreq *tx; struct verbs_txreq *tx;
tx = kmem_cache_alloc(dev->verbs_txreq_cache, GFP_ATOMIC); tx = kmem_cache_alloc(dev->verbs_txreq_cache, GFP_ATOMIC);
if (!tx) if (!tx) {
/* call slow path to get the lock */ /* call slow path to get the lock */
tx = __get_txreq(dev, qp); tx = __get_txreq(dev, qp);
if (tx) if (IS_ERR(tx))
tx->qp = qp; return tx;
}
tx->qp = qp;
return tx; return tx;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment