nfit: fix smatch "use after null check" report
authorDan Williams <dan.j.williams@intel.com>
Tue, 30 Jun 2015 20:09:39 +0000 (16:09 -0400)
committerDan Williams <dan.j.williams@intel.com>
Tue, 30 Jun 2015 20:09:39 +0000 (16:09 -0400)
commit193ccca43850d2355e7690a93ab9d7d78d38f905
treee70be5b260e1dc2d1d58154c4e17143851c33180
parentdaa1dee405d7d3d3e816b84a692e838a5647a02a
nfit: fix smatch "use after null check" report

drivers/acpi/nfit.c:1224 acpi_nfit_blk_region_enable()
         error: we previously assumed 'nfit_mem' could be null (see line 1223)

drivers/acpi/nfit.c
  1222          nfit_mem = nvdimm_provider_data(nvdimm);
  1223          if (!nfit_mem || !nfit_mem->dcr || !nfit_mem->bdw) {
                     ^^^^^^^^
Check.

  1224                  dev_dbg(dev, "%s: missing%s%s%s\n", __func__,
  1225                                  nfit_mem ? "" : " nfit_mem",
  1226                                  nfit_mem->dcr ? "" : " dcr",
                                        ^^^^^^^^^^^^^
Unchecked dereference.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/acpi/nfit.c