projects/linux·commit 2eea6582

nfit: fix translation of command status results

2eea6582 · Dan Williams <[email protected]> · 2016-05-02 09:11:53 -07:00

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 <[email protected]>
Reviewed-by: Johannes Thumshirn <[email protected]>
Signed-off-by: Dan Williams <[email protected]>
Commit
2eea65829dc6c20dccbe79726fd0f3fe7f8aa43b
Parents
658922e5

Changes

1 files changed · +4 −1

FileStatusAddDelContent
drivers/acpi/nfit.cmodified+4−1View file

drivers/acpi/nfit.c

View file
diff --git a/drivers/acpi/nfit.c b/drivers/acpi/nfit.c
index d0f35e6..63cc9db 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,
offset);
rc = -ENXIO;
}
- } else
+ } else {
rc = 0;
+ if (cmd_rc)
+ *cmd_rc = xlat_status(buf, cmd);
+ }
out:
ACPI_FREE(out_obj);