Skip to content

Commit 23458d7

Browse files
davejianggregkh
authored andcommitted
acpi/nfit: fix cmd_rc for acpi_nfit_ctl to always return a value
[ Upstream commit c1985ce ] 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]> Signed-off-by: Sasha Levin <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 21fe14f commit 23458d7

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
@@ -201,6 +201,7 @@ int acpi_nfit_ctl(struct nvdimm_bus_descriptor *nd_desc, struct nvdimm *nvdimm,
201201
const u8 *uuid;
202202
int rc, i;
203203

204+
*cmd_rc = -EINVAL;
204205
func = cmd;
205206
if (cmd == ND_CMD_CALL) {
206207
call_pkg = buf;
@@ -288,6 +289,7 @@ int acpi_nfit_ctl(struct nvdimm_bus_descriptor *nd_desc, struct nvdimm *nvdimm,
288289
* If we return an error (like elsewhere) then caller wouldn't
289290
* be able to rely upon data returned to make calculation.
290291
*/
292+
*cmd_rc = 0;
291293
return 0;
292294
}
293295

0 commit comments

Comments
 (0)