[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240618141851.1810000-2-richard.genoud@bootlin.com>
Date: Tue, 18 Jun 2024 16:18:49 +0200
From: Richard Genoud <richard.genoud@...tlin.com>
To: Alexandre Belloni <alexandre.belloni@...tlin.com>
Cc: Thomas Petazzoni <thomas.petazzoni@...tlin.com>,
Udit Kumar <u-kumar1@...com>,
Thomas Richard <thomas.richard@...tlin.com>,
Gregory CLEMENT <gregory.clement@...tlin.com>,
Esteban Blanc <eblanc@...libre.com>,
linux-rtc@...r.kernel.org,
Lee Jones <lee@...nel.org>,
linux-kernel@...r.kernel.org,
Richard Genoud <richard.genoud@...tlin.com>
Subject: [PATCH v3 1/3] rtc: tps6594: Fix memleak in probe
struct rtc_device is allocated twice in probe(), once with
devm_kzalloc(), and then with devm_rtc_allocate_device().
The allocation with devm_kzalloc() is lost and superfluous.
Fixes: 9f67c1e63976 ("rtc: tps6594: Add driver for TPS6594 RTC")
Signed-off-by: Richard Genoud <richard.genoud@...tlin.com>
---
drivers/rtc/rtc-tps6594.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/drivers/rtc/rtc-tps6594.c b/drivers/rtc/rtc-tps6594.c
index 838ae8562a35..bc8dc735aa23 100644
--- a/drivers/rtc/rtc-tps6594.c
+++ b/drivers/rtc/rtc-tps6594.c
@@ -360,10 +360,6 @@ static int tps6594_rtc_probe(struct platform_device *pdev)
int irq;
int ret;
- rtc = devm_kzalloc(dev, sizeof(*rtc), GFP_KERNEL);
- if (!rtc)
- return -ENOMEM;
-
rtc = devm_rtc_allocate_device(dev);
if (IS_ERR(rtc))
return PTR_ERR(rtc);
Powered by blists - more mailing lists