Skip to content

Commit dd8e34a

Browse files
johnpgarryChristoph Hellwig
authored andcommitted
nvme: fix endianness of command word prints in nvme_log_err_passthru()
The command word members of struct nvme_common_command are __le32 type, so use helper le32_to_cpu() to read them properly. Fixes: 9f079dd ("nvme: allow passthru cmd error logging") Signed-off-by: John Garry <[email protected]> Reviewed-by: Alan Adamson <[email protected]> Reviewed-by: Keith Busch <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
1 parent 80d7762 commit dd8e34a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

drivers/nvme/host/core.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -381,12 +381,12 @@ static void nvme_log_err_passthru(struct request *req)
381381
nr->status & NVME_SC_MASK, /* Status Code */
382382
nr->status & NVME_STATUS_MORE ? "MORE " : "",
383383
nr->status & NVME_STATUS_DNR ? "DNR " : "",
384-
nr->cmd->common.cdw10,
385-
nr->cmd->common.cdw11,
386-
nr->cmd->common.cdw12,
387-
nr->cmd->common.cdw13,
388-
nr->cmd->common.cdw14,
389-
nr->cmd->common.cdw15);
384+
le32_to_cpu(nr->cmd->common.cdw10),
385+
le32_to_cpu(nr->cmd->common.cdw11),
386+
le32_to_cpu(nr->cmd->common.cdw12),
387+
le32_to_cpu(nr->cmd->common.cdw13),
388+
le32_to_cpu(nr->cmd->common.cdw14),
389+
le32_to_cpu(nr->cmd->common.cdw15));
390390
}
391391

392392
enum nvme_disposition {

0 commit comments

Comments
 (0)