]> www.infradead.org Git - users/hch/misc.git/commit
nvme: fix incorrect sizeof
authorKanchan Joshi <joshi.k@samsung.com>
Tue, 6 May 2025 18:48:43 +0000 (00:18 +0530)
committerJens Axboe <axboe@kernel.dk>
Tue, 6 May 2025 19:46:36 +0000 (13:46 -0600)
commitf3c308b9d13ace45955e8406e3008f640f01faae
tree585d867e62ec79332bdc06df3ba5a3fce687c229
parent86b6e0bd1a69efd0ed408997e0adfb85df96a0c7
nvme: fix incorrect sizeof

The plid array, head->plids, is meant to store placement IDs, each of
type u16. But its size has been incorrectly calculated, as the size of
the pointer is being used instead of the size of the object it points
to.

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")
Reported-by: Caleb Sander Mateos <csander@purestorage.com>
Signed-off-by: Kanchan Joshi <joshi.k@samsung.com>
Reviewed-by: Caleb Sander Mateos <csander@purestorage.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/nvme/host/core.c