On Mon, Aug 03, 2026 at 09:30:15AM +0800, Warren Xiong wrote: > read_memory_info() invokes two shell pipelines to obtain MemFree and > Hugepagesize from /proc/meminfo. It does not check whether popen() > returns NULL before passing the result to fgets(), and it does not call > pclose() when fgets() fails. > > Open /proc/meminfo directly and obtain both values in a single pass. > This removes the unchecked NULL path, closes the file on all paths, and > avoids dependencies on external commands. > > The compaction test continues to pass after this change. > > Signed-off-by: Warren Xiong <[email protected]>
Acked-by: Mike Rapoport (Microsoft) <[email protected]> > --- > tools/testing/selftests/mm/compaction_test.c | 43 > +++++++++++++++++----------- > 1 file changed, 27 insertions(+), 16 deletions(-) -- Sincerely yours, Mike.

