Re: [PATCH v3 07/10] nvme-pci: implement dma_token backed requests

Pavel Begunkov
2026-04-30T18:18:48Z

On 4/29/26 17:07, Maurizio Lombardi wrote:
> On Wed Apr 29, 2026 at 5:25 PM CEST, Pavel Begunkov wrote:
>> Enable BIO_DMABUF_MAP backed requests. It creates a prp list for the
>> dmabuf when it's mapped, which is then used to initialise requests.
>>
>> Suggested-by: Keith Busch <kbusch@kernel.org>
>> Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
>> ---
...>> +
>> +static int nvme_create_dmabuf_token(struct request_queue *q,
>> + struct io_dmabuf_token *token)
>> +{
>> + struct nvme_dmabuf_token *data;
>> + struct dma_buf_attachment *attach;
>> + struct nvme_ns *ns = q->queuedata;
>> + struct nvme_dev *dev = to_nvme_dev(ns->ctrl);
>> + struct dma_buf *dmabuf = token->dmabuf;
>> +
>> + data = kzalloc(sizeof(data), GFP_KERNEL);
>> + if (!data)
>> + return -ENOMEM;
>
> Shouldn't this be kzalloc(sizeof(*data)...) ?

Good catch, I'll apply it all for next version

--
Pavel Begunkov