[bug report] RDMA/iw_cxgb4: atomically lookup ep and get a reference

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Hariprasad S,

This is a semi-automatic email about new static checker warnings.

The patch 944661dd97f4: "RDMA/iw_cxgb4: atomically lookup ep and get 
a reference" from May 6, 2016, leads to the following Smatch 
complaint:

    drivers/infiniband/hw/cxgb4/cm.c:2953 terminate()
    error: we previously assumed 'ep' could be null (see line 2945)

drivers/infiniband/hw/cxgb4/cm.c
  2944	
  2945		if (ep && ep->com.qp) {
                    ^^
Can this really be NULL?

  2946			pr_warn("TERM received tid %u qpid %u\n",
  2947				tid, ep->com.qp->wq.sq.qid);
  2948			attrs.next_state = C4IW_QP_STATE_TERMINATE;
  2949			c4iw_modify_qp(ep->com.qp->rhp, ep->com.qp,
  2950				       C4IW_QP_ATTR_NEXT_STATE, &attrs, 1);
  2951		} else
  2952			pr_warn("TERM received tid %u no ep/qp\n", tid);
  2953		c4iw_put_ep(&ep->com);
                            ^^^
The patch adds an unchecked dereference.

  2954	
  2955		return 0;

regards,
dan carpenter



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux