re: IB/mlx5: Add create and destroy functionality for Raw Packet QP

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

 



Hello majd@xxxxxxxxxxxx,

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

The patch 0fb2ed66a14c: "IB/mlx5: Add create and destroy 
functionality for Raw Packet QP" from Jan 14, 2016, leads to the 
following Smatch complaint:

drivers/infiniband/hw/mlx5/qp.c:1629 mlx5_ib_create_qp()
	 error: we previously assumed 'pd' could be null (see line 1616)

drivers/infiniband/hw/mlx5/qp.c
  1615	
  1616		if (pd) {
                    ^^
Check for NULL.

  1617			dev = to_mdev(pd->device);
  1618		} else {
  1619			/* being cautious here */
  1620			if (init_attr->qp_type != IB_QPT_XRC_TGT &&
  1621			    init_attr->qp_type != MLX5_IB_QPT_REG_UMR) {
  1622				pr_warn("%s: no PD for transport %s\n", __func__,
  1623					ib_qp_type_str(init_attr->qp_type));
  1624				return ERR_PTR(-EINVAL);
  1625			}
  1626			dev = to_mdev(to_mxrcd(init_attr->xrcd)->ibxrcd.device);
  1627	
  1628			if (init_attr->qp_type == IB_QPT_RAW_PACKET) {
  1629				if (!pd->uobject) {
                                     ^^^^^^^^^^^
Patch adds new NULL dereferences.

  1630					mlx5_ib_dbg(dev, "Raw Packet QP is not supported for kernel consumers\n");
  1631					return ERR_PTR(-EINVAL);

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



[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