From: Anton Vorontsov <cbouatmailru@gmail.com>
To: Lars-Peter Clausen <lars@metafoo.de>
Cc: linux-kernel@vger.kernel.org,
Vasiliy Kulikov <segoon@openwall.com>,
Dan Carpenter <error27@gmail.com>
Subject: Re: [PATCH] POWER: gpio-charger: Check result of kzalloc
Date: Wed, 22 Dec 2010 03:03:34 +0300 [thread overview]
Message-ID: <20101222000334.GA23799@oksana.dev.rtsoft.ru> (raw)
In-Reply-To: <1290118119-16468-1-git-send-email-lars@metafoo.de>
On Thu, Nov 18, 2010 at 11:08:37PM +0100, Lars-Peter Clausen wrote:
> Since kzalloc can return NULL we have to check its result.
>
> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
> ---
Lars, Vasiliy, Dan,
Thanks for the patch! I applied the following:
commit 2e9ff5f5e4c6b034554f3539f29529265279102c
Author: Lars-Peter Clausen <lars@metafoo.de>
Date: Thu Nov 18 23:08:37 2010 +0100
gpio-charger: Check result of kzalloc
Since kzalloc can return NULL we have to check its result.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Vasiliy Kulikov <segoon@openwall.com>
Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
diff --git a/drivers/power/gpio-charger.c b/drivers/power/gpio-charger.c
index fccbe99..8458caf 100644
--- a/drivers/power/gpio-charger.c
+++ b/drivers/power/gpio-charger.c
@@ -87,6 +87,10 @@ static int __devinit gpio_charger_probe(struct platform_device *pdev)
}
gpio_charger = kzalloc(sizeof(*gpio_charger), GFP_KERNEL);
+ if (!gpio_charger) {
+ dev_err(&pdev->dev, "Failed to alloc driver structure\n");
+ return -ENOMEM;
+ }
charger = &gpio_charger->charger;
prev parent reply other threads:[~2010-12-22 0:03 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-18 22:08 [PATCH] POWER: gpio-charger: Check result of kzalloc Lars-Peter Clausen
2010-11-18 22:08 ` [PATCH] POWER: gpio-charger: Fix potential race between irq handler and probe/remove function Lars-Peter Clausen
2010-12-22 0:05 ` Anton Vorontsov
2010-11-18 22:08 ` [PATCH] POWER: gpio-chager: Provide default name for the power_supply Lars-Peter Clausen
2010-12-22 0:04 ` Anton Vorontsov
2010-12-22 0:03 ` Anton Vorontsov [this message]
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=20101222000334.GA23799@oksana.dev.rtsoft.ru \
--to=cbouatmailru@gmail.com \
--cc=error27@gmail.com \
--cc=lars@metafoo.de \
--cc=linux-kernel@vger.kernel.org \
--cc=segoon@openwall.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