diff mbox series

[ndctl] ndctl/dimm: Fix submit_abort_firmware()

Message ID 20201222005704.2355076-1-jane.chu@oracle.com (mailing list archive)
State Accepted
Commit ea014c0c9ec8d0ef945d072dcc52b306c7a686f9
Headers show
Series [ndctl] ndctl/dimm: Fix submit_abort_firmware() | expand

Commit Message

Jane Chu Dec. 22, 2020, 12:57 a.m. UTC
commit f86369ea29e2 ("ndctl: merge firmware-update into dimm.c as another dimm operation")
introduces submit_abort_firmware() that calls
ndctl_cmd_fw_xlat_firmware_status() to parse status returned
from a firmware abort action. The callee returns FW_ notion of enum,
but the caller checks for ND_CMD_STATUS_FIN_ABORTED which is a bit mask.
So firmware abort always "fails" even when it succeeds.

Fixes: f86369ea29e2 ("ndctl: merge firmware-update into dimm.c as another dimm operation")
Tested-by: Mark Baker <mark.a.baker@oracle.com>
Signed-off-by: Jane Chu <jane.chu@oracle.com>
---
 ndctl/dimm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/ndctl/dimm.c b/ndctl/dimm.c
index 8bb7f672e35c..255dbe156a34 100644
--- a/ndctl/dimm.c
+++ b/ndctl/dimm.c
@@ -531,7 +531,7 @@  static int submit_abort_firmware(struct ndctl_dimm *dimm,
 		goto out;
 
 	status = ndctl_cmd_fw_xlat_firmware_status(cmd);
-	if (!(status & ND_CMD_STATUS_FIN_ABORTED)) {
+	if (status != FW_ABORTED) {
 		fprintf(stderr,
 			"Firmware update abort on DIMM %s failed: %#x\n",
 			ndctl_dimm_get_devname(dimm), status);