mirror of
https://github.com/hardkernel/linux.git
synced 2026-03-26 04:20:23 +09:00
zone_dma32_is_empty() currently lacks the proper validation to ensure that the NUMA node ID it receives as an argument is valid. This has no effect on kernels with CONFIG_NUMA=n as NODE_DATA() will return the same pglist_data on these devices, but on kernels with CONFIG_NUMA=y, this is not the case, and the node passed to NODE_DATA must be validated. Rather than trying to find the node containing ZONE_DMA32, replace calls of zone_dma32_is_empty() with zone_dma32_are_empty() (which iterates over all nodes and returns false if one of the nodes holds DMA32 and it is non-empty). Bug: 199917449 Fixes:c3c2bb34ac("ANDROID: arm64/mm: Add command line option to make ZONE_DMA32 empty") Signed-off-by: Chris Goldsworthy <quic_cgoldswo@quicinc.com> Change-Id: I850fb9213b71a1ef29106728bfda0cc6de46fdbb (cherry picked from commitbf96382fb9)