nfit: fix unchecked dereference in acpi_nfit_ctl
authorDave Jiang <dave.jiang@intel.com>
Wed, 11 Jul 2018 17:10:11 +0000 (10:10 -0700)
committerDave Jiang <dave.jiang@intel.com>
Wed, 11 Jul 2018 17:25:24 +0000 (10:25 -0700)
commitee6581ceba7f8314b81b2f2a81f1cf3f67c679e2
tree17853ef474ef89fe6a4ea78db734e0631bef5d7f
parent33cc2c9667561b224215e6dfb5bf98e8fa17914e
nfit: fix unchecked dereference in acpi_nfit_ctl

Incremental patch to fix the unchecked dereference in acpi_nfit_ctl.
Reported by Dan Carpenter:

"acpi/nfit: fix cmd_rc for acpi_nfit_ctl to
always return a value" from Jun 28, 2018, leads to the following
Smatch complaint:

    drivers/acpi/nfit/core.c:578 acpi_nfit_ctl()
     warn: variable dereferenced before check 'cmd_rc' (see line 411)

drivers/acpi/nfit/core.c
   410
   411 *cmd_rc = -EINVAL;
                ^^^^^^^^^^^^^^^^^^
Patch adds unchecked dereference.

Fixes: c1985cefd844 ("acpi/nfit: fix cmd_rc for acpi_nfit_ctl to always return a value")
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
drivers/acpi/nfit/core.c