Skip to content

Commit 77d2ef5

Browse files
johnpgarryjfvogel
authored andcommitted
nvme: fix endianness of command word prints in nvme_log_err_passthru()
[ Upstream commit dd8e34afd6709cb2f9c0e63340f567e6c066ed8e ] 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]> Signed-off-by: Sasha Levin <[email protected]> (cherry picked from commit 124765c206034d9f0bd07e7257c9e22c0af2e74e) Signed-off-by: Jack Vogel <[email protected]>
1 parent e49c6ad commit 77d2ef5

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
@@ -375,12 +375,12 @@ static void nvme_log_err_passthru(struct request *req)
375375
nr->status & NVME_SC_MASK, /* Status Code */
376376
nr->status & NVME_STATUS_MORE ? "MORE " : "",
377377
nr->status & NVME_STATUS_DNR ? "DNR " : "",
378-
nr->cmd->common.cdw10,
379-
nr->cmd->common.cdw11,
380-
nr->cmd->common.cdw12,
381-
nr->cmd->common.cdw13,
382-
nr->cmd->common.cdw14,
383-
nr->cmd->common.cdw15);
378+
le32_to_cpu(nr->cmd->common.cdw10),
379+
le32_to_cpu(nr->cmd->common.cdw11),
380+
le32_to_cpu(nr->cmd->common.cdw12),
381+
le32_to_cpu(nr->cmd->common.cdw13),
382+
le32_to_cpu(nr->cmd->common.cdw14),
383+
le32_to_cpu(nr->cmd->common.cdw15));
384384
}
385385

386386
enum nvme_disposition {

0 commit comments

Comments
 (0)