Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests/powerpc: Remove the path after initialization.

If there were no anamolies noted, then we can simply remove the log file
and return, but only after the path variable has been initialized.

Signed-off-by: zhang jiao <zhangjiao2@cmss.chinamobile.com>
Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://patch.msgid.link/20240930012757.2395-1-zhangjiao2@cmss.chinamobile.com

authored by

zhang jiao and committed by
Michael Ellerman
7ca93aa9 b196db2f

+5 -5
+5 -5
tools/testing/selftests/powerpc/mm/tlbie_test.c
··· 313 313 314 314 fclose(f); 315 315 316 - if (nr_anamolies == 0) { 317 - remove(path); 318 - return; 319 - } 320 - 321 316 sprintf(logfile, logfilename, tid); 322 317 strcpy(path, logdir); 323 318 strcat(path, separator); 324 319 strcat(path, logfile); 320 + 321 + if (nr_anamolies == 0) { 322 + remove(path); 323 + return; 324 + } 325 325 326 326 printf("Thread %02d chunk has %d corrupted words. For details check %s\n", 327 327 tid, nr_anamolies, path);