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

Configure Feed

Select the types of activity you want to include in your feed.

kselftest/arm64: fix a memleak in zt_regs_run()

If memcmp() does not return 0, "zeros" need to be freed to prevent memleak

Signed-off-by: Ding Xiang <dingxiang@cmss.chinamobile.com>
Link: https://lore.kernel.org/r/20230815074915.245528-1-dingxiang@cmss.chinamobile.com
Signed-off-by: Will Deacon <will@kernel.org>

authored by

Ding Xiang and committed by
Will Deacon
46862da1 358b763e

+1
+1
tools/testing/selftests/arm64/signal/testcases/zt_regs.c
··· 65 65 if (memcmp(zeros, (char *)zt + ZT_SIG_REGS_OFFSET, 66 66 ZT_SIG_REGS_SIZE(zt->nregs)) != 0) { 67 67 fprintf(stderr, "ZT data invalid\n"); 68 + free(zeros); 68 69 return 1; 69 70 } 70 71