[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <64931fac-085b-4ff3-9314-84bac2fa9bdb@quicinc.com>
Date: Mon, 9 Dec 2024 18:50:06 +0800
From: Baochen Qiang <quic_bqiang@...cinc.com>
To: Christoph Hellwig <hch@....de>,
Marek Szyprowski
<m.szyprowski@...sung.com>,
Robin Murphy <robin.murphy@....com>
CC: linux-kernel <linux-kernel@...r.kernel.org>, <iommu@...ts.linux.dev>
Subject: missing clear bdr in check_ram_in_range_map()?
Hi,
while checking check_ram_in_range_map() I am confused by the condition set/check on bdr.
If I am reading the code correctly, if bdr is set once, it would never get cleared, hence
that function will always returns 0.
should we clear bdr before each new iteration?
diff --git a/kernel/dma/direct.c b/kernel/dma/direct.c
index 5b4e6d3bf7bc..1605b956b25e 100644
--- a/kernel/dma/direct.c
+++ b/kernel/dma/direct.c
@@ -611,6 +611,7 @@ static int check_ram_in_range_map(unsigned long start_pfn,
return 1;
start_pfn = PFN_DOWN(bdr->cpu_start) + PFN_DOWN(bdr->size);
+ bdr = NULL;
}
return 0;
Powered by blists - more mailing lists