Skip to content

Commit c1985ce

Browse files
davejiangdjbw
authored andcommitted
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: aef2533 ("libnvdimm, nfit: centralize command status translation") Signed-off-by: Dave Jiang <[email protected]> Signed-off-by: Dan Williams <[email protected]>
1 parent 5a14e91 commit c1985ce

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/acpi/nfit/core.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,7 @@ int acpi_nfit_ctl(struct nvdimm_bus_descriptor *nd_desc, struct nvdimm *nvdimm,
408408
const guid_t *guid;
409409
int rc, i;
410410

411+
*cmd_rc = -EINVAL;
411412
func = cmd;
412413
if (cmd == ND_CMD_CALL) {
413414
call_pkg = buf;
@@ -518,6 +519,7 @@ int acpi_nfit_ctl(struct nvdimm_bus_descriptor *nd_desc, struct nvdimm *nvdimm,
518519
* If we return an error (like elsewhere) then caller wouldn't
519520
* be able to rely upon data returned to make calculation.
520521
*/
522+
*cmd_rc = 0;
521523
return 0;
522524
}
523525

0 commit comments

Comments
 (0)