IB/hfi1: Fix incorrect mixing of ERR_PTR and NULL return values
The __get_txreq() function can return a pointer, ERR_PTR(-EBUSY), or NULL.
All of the relevant call sites look for IS_ERR, so the NULL return would
lead to a NULL pointer exception.
Do not use the ERR_PTR mechanism for this function.
Update all call sites to handle the return value correctly.
Clean up error paths to reflect return value.
Fixes: 45842abbb2
("staging/rdma/hfi1: move txreq header code")
Cc: <stable@vger.kernel.org> # 4.9.x+
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Reviewed-by: Kamenee Arumugam <kamenee.arumugam@intel.com>
Signed-off-by: Michael J. Ruhl <michael.j.ruhl@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
这个提交包含在:
@@ -271,7 +271,7 @@ int hfi1_make_rc_req(struct rvt_qp *qp, struct hfi1_pkt_state *ps)
|
||||
|
||||
lockdep_assert_held(&qp->s_lock);
|
||||
ps->s_txreq = get_txreq(ps->dev, qp);
|
||||
if (IS_ERR(ps->s_txreq))
|
||||
if (!ps->s_txreq)
|
||||
goto bail_no_tx;
|
||||
|
||||
if (priv->hdr_type == HFI1_PKT_TYPE_9B) {
|
||||
|
在新工单中引用
屏蔽一个用户