>-----Original Message----- >From: linux-rdma-owner@xxxxxxxxxxxxxxx [mailto:linux-rdma- >owner@xxxxxxxxxxxxxxx] On Behalf Of Dan Carpenter >Sent: Thursday, June 14, 2018 10:32 AM >To: Marciniszyn, Mike <mike.marciniszyn@xxxxxxxxx> >Cc: linux-rdma@xxxxxxxxxxxxxxx >Subject: [bug report] staging/rdma/hfi1: move txreq header code > >Hello Mike Marciniszyn, > >The patch 45842abbb292: "staging/rdma/hfi1: move txreq header code" >from Feb 14, 2016, leads to the following static checker warning: > > drivers/infiniband/hw/hfi1/verbs_txreq.h:89 get_txreq() > warn: 'tx' can also be NULL > >drivers/infiniband/hw/hfi1/verbs_txreq.h > 75 static inline struct verbs_txreq *get_txreq(struct hfi1_ibdev *dev, > 76 struct rvt_qp *qp) > 77 __must_hold(&qp->slock) > 78 { > 79 struct verbs_txreq *tx; > 80 struct hfi1_qp_priv *priv = qp->priv; > 81 > 82 tx = kmem_cache_alloc(dev->verbs_txreq_cache, GFP_ATOMIC); > 83 if (unlikely(!tx)) { > 84 /* call slow path to get the lock */ > 85 tx = __get_txreq(dev, qp); > ^^^^^^^^^^^^^^^^^^^^ >The problem is that __get_txreq() returns a mix of error pointers and >NULL. I skimmed the function but it's not totally clear to me how it's >supposed to work. Arg. That is not good. Patch will be forthcoming. Mike > 86 if (IS_ERR(tx)) > 87 return tx; > 88 } > 89 tx->qp = qp; > 90 tx->mr = NULL; > 91 tx->sde = priv->s_sde; > 92 tx->psc = priv->s_sendcontext; > 93 /* so that we can test if the sdma decriptors are there */ > 94 tx->txreq.num_desc = 0; > 95 /* Set the header type */ > 96 tx->phdr.hdr.hdr_type = priv->hdr_type; > 97 return tx; > 98 } > >regards, >dan carpenter >-- >To unsubscribe from this list: send the line "unsubscribe linux-rdma" in >the body of a message to majordomo@xxxxxxxxxxxxxxx >More majordomo info at http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html