* [PATCH] nvme: fix incorrect sizeof [not found] <CGME20250506180545epcas5p34d4857f38b838532678728db22df6067@epcas5p3.samsung.com> @ 2025-05-06 17:56 ` Kanchan Joshi 2025-05-06 18:09 ` Caleb Sander Mateos 2025-05-06 18:09 ` Jens Axboe 0 siblings, 2 replies; 6+ messages in thread From: Kanchan Joshi @ 2025-05-06 17:56 UTC (permalink / raw) To: axboe, kbusch, linux-nvme; +Cc: csander, Kanchan Joshi 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 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] nvme: fix incorrect sizeof 2025-05-06 17:56 ` [PATCH] nvme: fix incorrect sizeof Kanchan Joshi @ 2025-05-06 18:09 ` Caleb Sander Mateos 2025-05-06 18:09 ` Jens Axboe 1 sibling, 0 replies; 6+ messages in thread From: Caleb Sander Mateos @ 2025-05-06 18:09 UTC (permalink / raw) To: Kanchan Joshi; +Cc: axboe, kbusch, linux-nvme On Tue, May 6, 2025 at 11:05 AM Kanchan Joshi <joshi.k@samsung.com> wrote: > > 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> Reviewed-by: Caleb Sander Mateos <csander@purestorage.com> ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] nvme: fix incorrect sizeof 2025-05-06 17:56 ` [PATCH] nvme: fix incorrect sizeof Kanchan Joshi 2025-05-06 18:09 ` 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 1 sibling, 2 replies; 6+ messages in thread From: Jens Axboe @ 2025-05-06 18:09 UTC (permalink / raw) To: Kanchan Joshi, kbusch, linux-nvme; +Cc: csander On 5/6/25 11:56 AM, Kanchan Joshi wrote: > 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> Reported-by: Caleb Sander Mateos <csander@purestorage.com> ? -- Jens Axboe ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] nvme: fix incorrect sizeof 2025-05-06 18:09 ` Jens Axboe @ 2025-05-06 18:13 ` Caleb Sander Mateos 2025-05-06 18:25 ` Kanchan Joshi/Kanchan Joshi 1 sibling, 0 replies; 6+ messages in thread From: Caleb Sander Mateos @ 2025-05-06 18:13 UTC (permalink / raw) To: Jens Axboe; +Cc: Kanchan Joshi, kbusch, linux-nvme On Tue, May 6, 2025 at 11:09 AM Jens Axboe <axboe@kernel.dk> wrote: > > On 5/6/25 11:56 AM, Kanchan Joshi wrote: > > 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> > > Reported-by: Caleb Sander Mateos <csander@purestorage.com> > > ? Yeah, if you wouldn't mind, I'd appreciate that. Best, Caleb ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] nvme: fix incorrect sizeof 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 1 sibling, 1 reply; 6+ messages in thread From: Kanchan Joshi/Kanchan Joshi @ 2025-05-06 18:25 UTC (permalink / raw) To: Jens Axboe, kbusch, linux-nvme; +Cc: csander On 5/6/2025 11:39 PM, Jens Axboe wrote: > Reported-by: Caleb Sander Mateos<csander@purestorage.com> > > ? indeed, missed that :-( ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] nvme: fix incorrect sizeof 2025-05-06 18:25 ` Kanchan Joshi/Kanchan Joshi @ 2025-05-06 18:29 ` Jens Axboe 0 siblings, 0 replies; 6+ messages in thread From: Jens Axboe @ 2025-05-06 18:29 UTC (permalink / raw) To: Kanchan Joshi/Kanchan Joshi, kbusch, linux-nvme; +Cc: csander On 5/6/25 12:25 PM, Kanchan Joshi/Kanchan Joshi wrote: > On 5/6/2025 11:39 PM, Jens Axboe wrote: >> Reported-by: Caleb Sander Mateos<csander@purestorage.com> >> >> ? > > indeed, missed that :-( The commit message is also very light. I know it's a basic issue, but let's at least try to have a full description of the issue. Can you send a v2 correcting those things? -- Jens Axboe ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2025-05-06 23:36 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <CGME20250506180545epcas5p34d4857f38b838532678728db22df6067@epcas5p3.samsung.com>
2025-05-06 17:56 ` [PATCH] nvme: fix incorrect sizeof Kanchan Joshi
2025-05-06 18:09 ` 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
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox