Commit c1985cef authored by Dave Jiang's avatar Dave Jiang Committed by Dan Williams

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: aef25338 ("libnvdimm, nfit: centralize command status translation")
Signed-off-by: default avatarDave Jiang <dave.jiang@intel.com>
Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
parent 5a14e91d
...@@ -408,6 +408,7 @@ int acpi_nfit_ctl(struct nvdimm_bus_descriptor *nd_desc, struct nvdimm *nvdimm, ...@@ -408,6 +408,7 @@ int acpi_nfit_ctl(struct nvdimm_bus_descriptor *nd_desc, struct nvdimm *nvdimm,
const guid_t *guid; const guid_t *guid;
int rc, i; int rc, i;
*cmd_rc = -EINVAL;
func = cmd; func = cmd;
if (cmd == ND_CMD_CALL) { if (cmd == ND_CMD_CALL) {
call_pkg = buf; call_pkg = buf;
...@@ -518,6 +519,7 @@ int acpi_nfit_ctl(struct nvdimm_bus_descriptor *nd_desc, struct nvdimm *nvdimm, ...@@ -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 * If we return an error (like elsewhere) then caller wouldn't
* be able to rely upon data returned to make calculation. * be able to rely upon data returned to make calculation.
*/ */
*cmd_rc = 0;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment