diff options
author | Dave Jiang <dave.jiang@intel.com> | 2018-06-28 09:56:55 -0700 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2018-06-30 10:43:39 -0700 |
commit | c1985cefd844e26bd19673a6df8d8f0b1918c2db (patch) | |
tree | 87addc030de43d9f993ea8cc284285ff019ca4dd | |
parent | 5a14e91d559aee5bdb0e002e1153fd9c4338a29e (diff) | |
download | linux-stable-c1985cefd844e26bd19673a6df8d8f0b1918c2db.tar.gz linux-stable-c1985cefd844e26bd19673a6df8d8f0b1918c2db.tar.bz2 linux-stable-c1985cefd844e26bd19673a6df8d8f0b1918c2db.zip |
acpi/nfit: fix cmd_rc for acpi_nfit_ctl to always return a value
cmd_rc is passed in by reference to the acpi_nfit_ctl() function and the
caller expects a value returned. However, when the package is pass through
via the ND_CMD_CALL command, cmd_rc is not touched. Make sure cmd_rc is
always set.
Fixes: aef253382266 ("libnvdimm, nfit: centralize command status translation")
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
-rw-r--r-- | drivers/acpi/nfit/core.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c index d15814e1727f..471402cee1f1 100644 --- a/drivers/acpi/nfit/core.c +++ b/drivers/acpi/nfit/core.c @@ -408,6 +408,7 @@ int acpi_nfit_ctl(struct nvdimm_bus_descriptor *nd_desc, struct nvdimm *nvdimm, const guid_t *guid; int rc, i; + *cmd_rc = -EINVAL; func = cmd; if (cmd == ND_CMD_CALL) { call_pkg = buf; @@ -518,6 +519,7 @@ int acpi_nfit_ctl(struct nvdimm_bus_descriptor *nd_desc, struct nvdimm *nvdimm, * If we return an error (like elsewhere) then caller wouldn't * be able to rely upon data returned to make calculation. */ + *cmd_rc = 0; return 0; } |