mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-16 09:13:55 +08:00
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: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
This commit is contained in:
parent
aeef010a0f
commit
50b19729ce
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user