All of lore.kernel.org
 help / color / mirror / Atom feed
From: chaitanya.kulkarni@wdc.com (Chaitanya Kulkarni)
Subject: [PATCH]  nvme-cli: fix ana-log endianness
Date: Wed, 24 Oct 2018 11:47:01 -0700	[thread overview]
Message-ID: <20181024184701.12158-1-chaitanya.kulkarni@wdc.com> (raw)

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni at wdc.com>
---
 nvme.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/nvme.c b/nvme.c
index 4b2d1d2..c961cc5 100644
--- a/nvme.c
+++ b/nvme.c
@@ -273,7 +273,7 @@ static int get_ana_log(int argc, char **argv, struct command *cmd,
 	ana_log_len = sizeof(struct nvme_ana_rsp_hdr) +
 		le32_to_cpu(ctrl.nanagrpid) * sizeof(struct nvme_ana_group_desc);
 	if (!(ctrl.anacap & (1 << 6)))
-		ana_log_len += ctrl.mnan * sizeof(__le32);
+		ana_log_len += le32_to_cpu(ctrl.mnan) * sizeof(__le32);
 
 	ana_log = malloc(ana_log_len);
 	if (!ana_log) {
-- 
2.17.0

             reply	other threads:[~2018-10-24 18:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-24 18:47 Chaitanya Kulkarni [this message]
2018-10-24 21:56 ` [PATCH] nvme-cli: fix ana-log endianness Keith Busch

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181024184701.12158-1-chaitanya.kulkarni@wdc.com \
    --to=chaitanya.kulkarni@wdc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.