]> www.infradead.org Git - users/mchehab/rasdaemon.git/commitdiff
rasdaemon: fix memory leak in ras-events.c:handle_ras_events()
authorShiju Jose <shiju.jose@huawei.com>
Wed, 16 Oct 2019 16:33:56 +0000 (17:33 +0100)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Wed, 20 Nov 2019 04:16:24 +0000 (05:16 +0100)
This patch fix memory leak in handle_ras_events()
when failed to trace all supported RAS events.

Signed-off-by: Shiju Jose <shiju.jose@huawei.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
ras-events.c

index d1773b122d2c2504e5c9beb223c0d17f45942eb4..d5432512f43f120c6d1c0a956e46d4e5565f38dd 100644 (file)
@@ -846,7 +846,8 @@ int handle_ras_events(int record_events)
        if (!num_events) {
                log(ALL, LOG_INFO,
                    "Failed to trace all supported RAS events. Aborting.\n");
-               return EINVAL;
+               rc = -EINVAL;
+               goto err;
        }
 
        data = calloc(sizeof(*data), cpus);