Skip to content

Commit 7ca93aa

Browse files
zhang jiaompe
authored andcommitted
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
1 parent b196db2 commit 7ca93aa

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

tools/testing/selftests/powerpc/mm/tlbie_test.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -313,16 +313,16 @@ static inline void end_verification_log(unsigned int tid, unsigned nr_anamolies)
313313

314314
fclose(f);
315315

316-
if (nr_anamolies == 0) {
317-
remove(path);
318-
return;
319-
}
320-
321316
sprintf(logfile, logfilename, tid);
322317
strcpy(path, logdir);
323318
strcat(path, separator);
324319
strcat(path, logfile);
325320

321+
if (nr_anamolies == 0) {
322+
remove(path);
323+
return;
324+
}
325+
326326
printf("Thread %02d chunk has %d corrupted words. For details check %s\n",
327327
tid, nr_anamolies, path);
328328
}

0 commit comments

Comments
 (0)