Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2415957ybi; Mon, 17 Jun 2019 04:32:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqyS0E1L7upbj36VHCFK53VWlJ9tIJHYGZfiQo5rSxyAv/7e6odPHyaCXBAQKCAKyaCOgMZP X-Received: by 2002:a62:6241:: with SMTP id w62mr18655396pfb.226.1560771176479; Mon, 17 Jun 2019 04:32:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560771176; cv=none; d=google.com; s=arc-20160816; b=JAnqI1i3cdNVFUSrnsX/VcnBMUven6LRY3jdxwg7oAIRbwUkfofxuW5+Ulv2D41UID uCctzKYTWsGwZotCUdDMXlz1w4A/zlsqIaiLXW6JIygg+MEczGB9nqMNtdqJftQEtBj1 FevMiZkpWujN3Ois+o2v21VgMcD8pV5VNyoN9uCNFKDz+dPdbNiPrmRYujhWRHySzZ50 eMbW0kLUW60ACtqsioEEf5VyHBeByCrYfIbnX9iYwpqd/phBcyvbwvQwPquXOvcd4sXR BNyqV2lbQZj9BFZVX8ibDRCOIrTRLwTyQBCch/XnRhaH/PefqyZpMibUtezsEtus94fR Uatw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=7tcbHMykHTrv+3MFxPOz0QAVbC9E1p2pP/KiQHen1vk=; b=IEqgfEs0TFnMpAfHrYIJeR27vp2XgexTyYGORL1viUqrSLPx2sUTqOTKzgOTC5EatU QZtDo7Efu7njwcehK6niJAydQK+bAqALNn4/3RHlw+LSCZg/nhy7x87IXOxHi9I38Um3 ewRZ623YuqKD44vmouDwi9tWA3Y3Tu2bpsvF8/s+EENzmXLA3Te6gJOcJ6koShU+ZfDT J23SqRKwFZuYXHb/dTTDkKbnoV4Zo+howj1j12TbWI9l9oX1XJR3MqMXAnfcvxGiiil3 jPXmm1x6irD2RNIpjct8Rybl3agwKpLM5Qm+EhkL1izVCQcuRZdNO+6S9pXf6Jvf5I4i RymQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t17si7684707pjw.99.2019.06.17.04.32.39; Mon, 17 Jun 2019 04:32:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727999AbfFQLbM (ORCPT + 99 others); Mon, 17 Jun 2019 07:31:12 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:45645 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725681AbfFQLbM (ORCPT ); Mon, 17 Jun 2019 07:31:12 -0400 Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1hcpqv-0008OW-Ou; Mon, 17 Jun 2019 11:31:09 +0000 From: Colin King To: Bartosz Golaszewski , Daniel Lezcano , Thomas Gleixner Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH][next] clocksource: davinci-timer: fix memory leak of clockevent on error return Date: Mon, 17 Jun 2019 12:31:09 +0100 Message-Id: <20190617113109.24689-1-colin.king@canonical.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Colin Ian King 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 --- 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