Skip to content

Commit 9a901f5

Browse files
stellarhopperdjbw
authored andcommitted
acpi, nfit: fix extended status translations for ACPI DSMs
ACPI DSMs can have an 'extended' status which can be non-zero to convey additional information about the command. In the xlat_status routine, where we translate the command statuses, we were returning an error for a non-zero extended status, even if the primary status indicated success. Return from each command's 'case' once we have verified both its status and extend status are good. Cc: <[email protected]> Fixes: 11294d6 ("nfit: fail DSMs that return non-zero status by default") Signed-off-by: Vishal Verma <[email protected]> Signed-off-by: Dan Williams <[email protected]>
1 parent 3e5de27 commit 9a901f5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/acpi/nfit/core.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ static int xlat_status(void *buf, unsigned int cmd, u32 status)
113113
flags = ND_ARS_PERSISTENT | ND_ARS_VOLATILE;
114114
if ((status >> 16 & flags) == 0)
115115
return -ENOTTY;
116-
break;
116+
return 0;
117117
case ND_CMD_ARS_START:
118118
/* ARS is in progress */
119119
if ((status & 0xffff) == NFIT_ARS_START_BUSY)
@@ -122,7 +122,7 @@ static int xlat_status(void *buf, unsigned int cmd, u32 status)
122122
/* Command failed */
123123
if (status & 0xffff)
124124
return -EIO;
125-
break;
125+
return 0;
126126
case ND_CMD_ARS_STATUS:
127127
ars_status = buf;
128128
/* Command failed */
@@ -154,7 +154,7 @@ static int xlat_status(void *buf, unsigned int cmd, u32 status)
154154
/* Unknown status */
155155
if (status >> 16)
156156
return -EIO;
157-
break;
157+
return 0;
158158
case ND_CMD_CLEAR_ERROR:
159159
clear_err = buf;
160160
if (status & 0xffff)
@@ -163,7 +163,7 @@ static int xlat_status(void *buf, unsigned int cmd, u32 status)
163163
return -EIO;
164164
if (clear_err->length > clear_err->cleared)
165165
return clear_err->cleared;
166-
break;
166+
return 0;
167167
default:
168168
break;
169169
}

0 commit comments

Comments
 (0)