]> git.itanic.dy.fi Git - linux-stable/commitdiff
perf pmu: zfree() expects a pointer to a pointer to zero it after freeing its contents
authorArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 12 Apr 2023 13:23:35 +0000 (10:23 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 May 2023 09:50:20 +0000 (11:50 +0200)
[ Upstream commit 57f14b5ae1a97537f2abd2828ee7212cada7036e ]

An audit showed just this one problem with zfree(), fix it.

Fixes: 9fbc61f832ebf432 ("perf pmu: Add support for PMU capabilities")
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/perf/util/pmu.c

index 26c0b88cef4c8fe06289a534525ffc8888005e98..eafd80be66076c6d87c932e905fd66a6082ca093 100644 (file)
@@ -1858,7 +1858,7 @@ static int perf_pmu__new_caps(struct list_head *list, char *name, char *value)
        return 0;
 
 free_name:
-       zfree(caps->name);
+       zfree(&caps->name);
 free_caps:
        free(caps);