Skip to contentSkip to conversation

IB/ipath: infiniband verbs support

DISCUSSION Dan Carpenter 1 participant 1 message Sep 16, 2015 InfiniBand

lore
Share & tools
lore
#0 lore raw

Hello Bryan O'Sullivan,

The patch 6522108f19a9: "IB/ipath: infiniband verbs support" from Mar 29, 2006, leads to the following static checker warning:

drivers/staging/rdma/ipath/ipath_verbs.c:2289 show_hca()
warn: bool is not less than zero.

drivers/staging/rdma/ipath/ipath_verbs.c
2281 static ssize_t show_hca(struct device *device, struct device_attribute *attr,
2282 char *buf)
2283 {
2284 struct ipath_ibdev *dev =
2285 container_of(device, struct ipath_ibdev, ibdev.dev);
2286 int ret;
2287
2288 ret = dev->dd->ipath_f_get_boardname(dev->dd, buf, 128);
2289 if (ret < 0)

ret is either zero or one, not negative. There is some dead code in ipath_ht_boardname() which indicates that it might have returned error codes at some point as well.

This warning is from a too many false positives to publish Smatch check.

  2290                  goto bail;
  2291          strcat(buf, "\n");
  2292          ret = strlen(buf);
  2293  
  2294  bail:
  2295          return ret;
  2296  }

regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html