提交 50b19729 编写于 作者: D Dan Carpenter 提交者: 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: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NDoug Ledford <dledford@redhat.com>
上级 aeef010a
......@@ -749,11 +749,13 @@ static inline struct verbs_txreq *get_txreq(struct hfi1_ibdev *dev,
struct verbs_txreq *tx;
tx = kmem_cache_alloc(dev->verbs_txreq_cache, GFP_ATOMIC);
if (!tx)
if (!tx) {
/* call slow path to get the lock */
tx = __get_txreq(dev, qp);
if (tx)
tx->qp = qp;
if (IS_ERR(tx))
return tx;
}
tx->qp = qp;
return tx;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册