aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2016-05-02 12:11:53 -0400
committerDan Williams <dan.j.williams@intel.com>2016-05-02 12:11:53 -0400
commit2eea65829dc6c20dccbe79726fd0f3fe7f8aa43b (patch)
treed18453036e12539f37828541244b74811b167f6a
parent658922e57b847bb7112aa67f6441b6bbc6554412 (diff)
nfit: fix translation of command status results
When transportation of the command completes successfully, it indicates that the 'status' result is valid. Fix the missed checking and translation of the status field at the end of acpi_nfit_ctl(). Otherwise, we fail to handle reported errors and assume commands complete successfully. Reported-by: Linda Knippers <linda.knippers@hpe.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
-rw-r--r--drivers/acpi/nfit.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/acpi/nfit.c b/drivers/acpi/nfit.c
index d0f35e63640b..63cc9dbe4f3b 100644
--- a/drivers/acpi/nfit.c
+++ b/drivers/acpi/nfit.c
@@ -287,8 +287,11 @@ static int acpi_nfit_ctl(struct nvdimm_bus_descriptor *nd_desc,
287 offset); 287 offset);
288 rc = -ENXIO; 288 rc = -ENXIO;
289 } 289 }
290 } else 290 } else {
291 rc = 0; 291 rc = 0;
292 if (cmd_rc)
293 *cmd_rc = xlat_status(buf, cmd);
294 }
292 295
293 out: 296 out:
294 ACPI_FREE(out_obj); 297 ACPI_FREE(out_obj);