Patch "kselftest/arm64: fix a memleak in zt_regs_run()" has been added to the 6.5-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    kselftest/arm64: fix a memleak in zt_regs_run()

to the 6.5-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     kselftest-arm64-fix-a-memleak-in-zt_regs_run.patch
and it can be found in the queue-6.5 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 159d05f1029d60bee18bba46d48b5bc20600d39c
Author: Ding Xiang <dingxiang@xxxxxxxxxxxxxxxxxxxx>
Date:   Tue Aug 15 15:49:15 2023 +0800

    kselftest/arm64: fix a memleak in zt_regs_run()
    
    [ Upstream commit 46862da15e37efedb7d2d21e167f506c0b533772 ]
    
    If memcmp() does not return 0, "zeros" need to be freed to prevent memleak
    
    Signed-off-by: Ding Xiang <dingxiang@xxxxxxxxxxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20230815074915.245528-1-dingxiang@xxxxxxxxxxxxxxxxxxxx
    Signed-off-by: Will Deacon <will@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/tools/testing/selftests/arm64/signal/testcases/zt_regs.c b/tools/testing/selftests/arm64/signal/testcases/zt_regs.c
index e1eb4d5c027ab..2e384d731618b 100644
--- a/tools/testing/selftests/arm64/signal/testcases/zt_regs.c
+++ b/tools/testing/selftests/arm64/signal/testcases/zt_regs.c
@@ -65,6 +65,7 @@ int zt_regs_run(struct tdescr *td, siginfo_t *si, ucontext_t *uc)
 	if (memcmp(zeros, (char *)zt + ZT_SIG_REGS_OFFSET,
 		   ZT_SIG_REGS_SIZE(zt->nregs)) != 0) {
 		fprintf(stderr, "ZT data invalid\n");
+		free(zeros);
 		return 1;
 	}
 



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux