Skip to contentSkip to conversation

ndctl/dimm: Fix submit_abort_firmware()

PATCH New Jane Chu 1 participant 1 message Dec 22, 2020 libnvdimm: non-volatile memory device

lore
Share & tools
lore

Jane Chu

author
#0 lore raw

PATCH 1/1 ndctl/dimm: Fix submit_abort_firmware()

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")
---
 ndctl/dimm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
ndctl/dimm.c +1 -1
index 8bb7f672e35c..255dbe156a34 100644
@@ -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);
Signature · 4 lines
2.18.4
_______________________________________________
Linux-nvdimm mailing list -- [email protected]
To unsubscribe send an email to [email protected]