[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aYGSP4luf1nOFhS2@kbusch-mbp>
Date: Mon, 2 Feb 2026 23:14:23 -0700
From: Keith Busch <kbusch@...nel.org>
To: Christoph Hellwig <hch@....de>
Cc: Robin Murphy <robin.murphy@....com>,
Pradeep P V K <pradeep.pragallapati@....qualcomm.com>,
axboe@...nel.dk, sagi@...mberg.me, linux-nvme@...ts.infradead.org,
linux-kernel@...r.kernel.org, nitin.rawat@....qualcomm.com,
Leon Romanovsky <leon@...nel.org>,
Marek Szyprowski <m.szyprowski@...sung.com>, iommu@...ts.linux.dev
Subject: Re: [PATCH V1] nvme-pci: Fix NULL pointer dereference in
nvme_pci_prp_iter_next
On Tue, Feb 03, 2026 at 06:27:56AM +0100, Christoph Hellwig wrote:
> > iod->nr_descriptors = 0;
> > iod->total_len = 0;
> > iod->meta_total_len = 0;
> > + iod->nr_dma_vecs = 0;
> > + iod->dma_vecs = NULL;
>
> I don't think we need the dma_vecs initialization here, as everything
> is keyed off nr_dma_vecs.
Yes, we should definitely use nr_dma_vecs and skip the NULL setting. I'm
a big fan removing unnecessary initialisations. Just a caution, my
suggested patch has this check:
if (!iod->dma_vecs)
So we just need to update it to use 'iod->nr_dma_vecs' instead, which
would have been correct, too.
Powered by blists - more mailing lists