Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Kanchan Joshi <joshi.k@samsung.com>
To: axboe@kernel.dk, kbusch@kernel.org, linux-nvme@lists.infradead.org
Cc: csander@purestorage.com, Kanchan Joshi <joshi.k@samsung.com>
Subject: [PATCH] nvme: fix incorrect sizeof
Date: Tue,  6 May 2025 23:26:56 +0530	[thread overview]
Message-ID: <20250506175656.23151-1-joshi.k@samsung.com> (raw)
In-Reply-To: CGME20250506180545epcas5p34d4857f38b838532678728db22df6067@epcas5p3.samsung.com

Use the sizeof(*head->plids) in kcalloc so that we don't allocate extra.

Fixes: 38e8397dde63 ("nvme: use fdp streams if write stream is provided")
Signed-off-by: Kanchan Joshi <joshi.k@samsung.com>
---
 drivers/nvme/host/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 52331a14bce1..7c1b9f2bf0ae 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -2296,7 +2296,7 @@ static int nvme_query_fdp_info(struct nvme_ns *ns, struct nvme_ns_info *info)
 	if (!head->nr_plids)
 		goto free;
 
-	head->plids = kcalloc(head->nr_plids, sizeof(head->plids),
+	head->plids = kcalloc(head->nr_plids, sizeof(*head->plids),
 			      GFP_KERNEL);
 	if (!head->plids) {
 		dev_warn(ctrl->device,
-- 
2.25.1



       reply	other threads:[~2025-05-06 23:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20250506180545epcas5p34d4857f38b838532678728db22df6067@epcas5p3.samsung.com>
2025-05-06 17:56 ` Kanchan Joshi [this message]
2025-05-06 18:09   ` [PATCH] nvme: fix incorrect sizeof Caleb Sander Mateos
2025-05-06 18:09   ` Jens Axboe
2025-05-06 18:13     ` Caleb Sander Mateos
2025-05-06 18:25     ` Kanchan Joshi/Kanchan Joshi
2025-05-06 18:29       ` Jens Axboe

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=20250506175656.23151-1-joshi.k@samsung.com \
    --to=joshi.k@samsung.com \
    --cc=axboe@kernel.dk \
    --cc=csander@purestorage.com \
    --cc=kbusch@kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox