From: Richard Genoud <richard.genoud@bootlin.com>
To: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
Udit Kumar <u-kumar1@ti.com>,
Thomas Richard <thomas.richard@bootlin.com>,
Gregory CLEMENT <gregory.clement@bootlin.com>,
Esteban Blanc <eblanc@baylibre.com>,
linux-rtc@vger.kernel.org, Lee Jones <lee@kernel.org>,
linux-kernel@vger.kernel.org,
Richard Genoud <richard.genoud@bootlin.com>
Subject: [PATCH v3 1/3] rtc: tps6594: Fix memleak in probe
Date: Tue, 18 Jun 2024 16:18:49 +0200 [thread overview]
Message-ID: <20240618141851.1810000-2-richard.genoud@bootlin.com> (raw)
In-Reply-To: <20240618141851.1810000-1-richard.genoud@bootlin.com>
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@bootlin.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);
next prev parent reply other threads:[~2024-06-18 14:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-18 14:18 [PATCH v3 0/3] rtc: tps6594: Add power management support Richard Genoud
2024-06-18 14:18 ` Richard Genoud [this message]
2024-06-18 14:18 ` [PATCH v3 2/3] rtc: tps6594: introduce private structure as drvdata Richard Genoud
2024-06-18 14:18 ` [PATCH v3 3/3] rtc: tps6594: Add power management support Richard Genoud
2024-06-27 22:22 ` [PATCH v3 0/3] " Alexandre Belloni
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240618141851.1810000-2-richard.genoud@bootlin.com \
--to=richard.genoud@bootlin.com \
--cc=alexandre.belloni@bootlin.com \
--cc=eblanc@baylibre.com \
--cc=gregory.clement@bootlin.com \
--cc=lee@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rtc@vger.kernel.org \
--cc=thomas.petazzoni@bootlin.com \
--cc=thomas.richard@bootlin.com \
--cc=u-kumar1@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®