lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190617113109.24689-1-colin.king@canonical.com>
Date:   Mon, 17 Jun 2019 12:31:09 +0100
From:   Colin King <colin.king@...onical.com>
To:     Bartosz Golaszewski <bgolaszewski@...libre.com>,
        Daniel Lezcano <daniel.lezcano@...aro.org>,
        Thomas Gleixner <tglx@...utronix.de>
Cc:     kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH][next] clocksource: davinci-timer: fix memory leak of clockevent on error return

From: Colin Ian King <colin.king@...onical.com>

Currently when the call to request_irq falls there is a memory leak of
clockevent on the error return path. Fix this by kfree'ing clockevent.

Addresses-Coverity: ("Resource leak")
Fixes: fe3b8194f274 ("clocksource: davinci-timer: add support for clockevents")
Signed-off-by: Colin Ian King <colin.king@...onical.com>
---
 drivers/clocksource/timer-davinci.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/clocksource/timer-davinci.c b/drivers/clocksource/timer-davinci.c
index a9ca02390b66..8512f12e250a 100644
--- a/drivers/clocksource/timer-davinci.c
+++ b/drivers/clocksource/timer-davinci.c
@@ -300,6 +300,7 @@ int __init davinci_timer_register(struct clk *clk,
 			 "clockevent/tim12", clockevent);
 	if (rv) {
 		pr_err("Unable to request the clockevent interrupt");
+		kfree(clockevent);
 		return rv;
 	}
 
-- 
2.20.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ