[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260203062334.GI16426@lst.de>
Date: Tue, 3 Feb 2026 07:23:34 +0100
From: Christoph Hellwig <hch@....de>
To: Keith Busch <kbusch@...nel.org>
Cc: Christoph Hellwig <hch@....de>, 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 Mon, Feb 02, 2026 at 11:14:23PM -0700, Keith Busch wrote:
> 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.
Ah, right.
Powered by blists - more mailing lists