Skip to content

Commit c845344

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 f06fae1 commit c845344

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
@@ -224,6 +224,7 @@ int acpi_nfit_ctl(struct nvdimm_bus_descriptor *nd_desc, struct nvdimm *nvdimm,
224224
const guid_t *guid;
225225
int rc, i;
226226

227+
*cmd_rc = -EINVAL;
227228
func = cmd;
228229
if (cmd == ND_CMD_CALL) {
229230
call_pkg = buf;
@@ -314,6 +315,7 @@ int acpi_nfit_ctl(struct nvdimm_bus_descriptor *nd_desc, struct nvdimm *nvdimm,
314315
* If we return an error (like elsewhere) then caller wouldn't
315316
* be able to rely upon data returned to make calculation.
316317
*/
318+
*cmd_rc = 0;
317319
return 0;
318320
}
319321

0 commit comments

Comments
 (0)