From: Axel Lin <axel.lin@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Wolfram Sang <w.sang@pengutronix.de>, Liam Girdwood <lrg@ti.com>,
Mark Brown <broonie@opensource.wolfsonmicro.com>
Subject: [PATCH] regulator: max8660: Fix a memory leak due to missing devm_kzalloc conversion
Date: Tue, 17 Apr 2012 18:06:50 +0800 [thread overview]
Message-ID: <1334657210.7265.1.camel@phoenix> (raw)
commit 4d26f7 "regulator: max8660: Use devm_kzalloc()" missed to
replace kzalloc by devm_kzalloc. Fix it.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
drivers/regulator/max8660.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/regulator/max8660.c b/drivers/regulator/max8660.c
index 9997cfb..5d56817 100644
--- a/drivers/regulator/max8660.c
+++ b/drivers/regulator/max8660.c
@@ -370,7 +370,7 @@ static int __devinit max8660_probe(struct i2c_client *client,
return -EINVAL;
}
- max8660 = kzalloc(sizeof(struct max8660) +
+ max8660 = devm_kzalloc(&client->dev, sizeof(struct max8660) +
sizeof(struct regulator_dev *) * MAX8660_V_END,
GFP_KERNEL);
if (!max8660)
--
1.7.5.4
next reply other threads:[~2012-04-17 10:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-17 10:06 Axel Lin [this message]
2012-04-17 13:44 ` [PATCH] regulator: max8660: Fix a memory leak due to missing devm_kzalloc conversion Mark Brown
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=1334657210.7265.1.camel@phoenix \
--to=axel.lin@gmail.com \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lrg@ti.com \
--cc=w.sang@pengutronix.de \
/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