Hello Dan Williams,
The patch 3b37efc863b1: "libnvdimm, pmem: prepare for handling
badblocks via nvdimm_read_bytes()" from Jan 4, 2016, leads to the
following static checker warning:
drivers/nvdimm/core.c:479 nvdimm_namespace_badblocks()
error: passing non negative 1 to ERR_PTR
drivers/nvdimm/core.c
475
476 rc = __add_badblock_range(&ndns->dev, &bb,
477 start - ns_start, len);
This function should probably not return 1 but it does in couple
places because badblocks_set() returns either one or zero. You didn't
introduce this bug, but Smatch detects it now.
478 if (rc)
479 return ERR_PTR(rc);
480 dev_info(&nvdimm_bus->dev,
481 "Found a poison range (0x%llx,
0x%llx)\n",
482 start, len);
483 continue;
484 }
Also:
drivers/nvdimm/core.c:496 nvdimm_namespace_badblocks() error: passing non negative 1 to
ERR_PTR
regards,
dan carpenter