* [patch -next] power/gpio-charger: check for kzalloc() failure
@ 2010-12-20 13:08 ` Dan Carpenter
0 siblings, 0 replies; 6+ messages in thread
From: Dan Carpenter @ 2010-12-20 13:08 UTC (permalink / raw)
To: Lars-Peter Clausen; +Cc: Anton Vorontsov, linux-kernel, kernel-janitors
Return -ENOMEM if kzalloc() fails.
Signed-off-by: Dan Carpenter <error27@gmail.com>
diff --git a/drivers/power/gpio-charger.c b/drivers/power/gpio-charger.c
index fccbe99..06a74f0 100644
--- a/drivers/power/gpio-charger.c
+++ b/drivers/power/gpio-charger.c
@@ -87,6 +87,8 @@ static int __devinit gpio_charger_probe(struct platform_device *pdev)
}
gpio_charger = kzalloc(sizeof(*gpio_charger), GFP_KERNEL);
+ if (!gpio_charger)
+ return -ENOMEM;
charger = &gpio_charger->charger;
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [patch -next] power/gpio-charger: check for kzalloc() failure
@ 2010-12-20 13:08 ` Dan Carpenter
0 siblings, 0 replies; 6+ messages in thread
From: Dan Carpenter @ 2010-12-20 13:08 UTC (permalink / raw)
To: Lars-Peter Clausen; +Cc: Anton Vorontsov, linux-kernel, kernel-janitors
Return -ENOMEM if kzalloc() fails.
Signed-off-by: Dan Carpenter <error27@gmail.com>
diff --git a/drivers/power/gpio-charger.c b/drivers/power/gpio-charger.c
index fccbe99..06a74f0 100644
--- a/drivers/power/gpio-charger.c
+++ b/drivers/power/gpio-charger.c
@@ -87,6 +87,8 @@ static int __devinit gpio_charger_probe(struct platform_device *pdev)
}
gpio_charger = kzalloc(sizeof(*gpio_charger), GFP_KERNEL);
+ if (!gpio_charger)
+ return -ENOMEM;
charger = &gpio_charger->charger;
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [patch -next] power/gpio-charger: check for kzalloc() failure
2010-12-20 13:08 ` Dan Carpenter
@ 2010-12-20 20:04 ` Lars-Peter Clausen
-1 siblings, 0 replies; 6+ messages in thread
From: Lars-Peter Clausen @ 2010-12-20 20:04 UTC (permalink / raw)
To: Dan Carpenter, Anton Vorontsov; +Cc: linux-kernel, kernel-janitors
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 12/20/2010 02:08 PM, Dan Carpenter wrote:
> Return -ENOMEM if kzalloc() fails.
>
> Signed-off-by: Dan Carpenter <error27@gmail.com>
>
> diff --git a/drivers/power/gpio-charger.c b/drivers/power/gpio-charger.c
> index fccbe99..06a74f0 100644
> --- a/drivers/power/gpio-charger.c
> +++ b/drivers/power/gpio-charger.c
> @@ -87,6 +87,8 @@ static int __devinit gpio_charger_probe(struct platform_device *pdev)
> }
>
> gpio_charger = kzalloc(sizeof(*gpio_charger), GFP_KERNEL);
> + if (!gpio_charger)
> + return -ENOMEM;
>
> charger = &gpio_charger->charger;
>
Hi
This is now the 4th patch or so fixing this issue. I send the first one[1], together
with some other fixes[2][3], a month ago.
Anton could you please pick them up?
Thanks
- - Lars
[1] http://lkml.indiana.edu/hypermail/linux/kernel/1011.2/02029.html
[2] http://lkml.indiana.edu/hypermail/linux/kernel/1011.2/02028.html
[3] http://lkml.indiana.edu/hypermail/linux/kernel/1011.2/02030.html
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAk0PtuYACgkQBX4mSR26RiOCRQCfdKUdpAjX2GxAJuGVekZDiyjx
j3IAnRCS562ud3Ali/B5V1gWNeBHcxNj
=M4Vg
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [patch -next] power/gpio-charger: check for kzalloc() failure
@ 2010-12-20 20:04 ` Lars-Peter Clausen
0 siblings, 0 replies; 6+ messages in thread
From: Lars-Peter Clausen @ 2010-12-20 20:04 UTC (permalink / raw)
To: Dan Carpenter, Anton Vorontsov; +Cc: linux-kernel, kernel-janitors
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 12/20/2010 02:08 PM, Dan Carpenter wrote:
> Return -ENOMEM if kzalloc() fails.
>
> Signed-off-by: Dan Carpenter <error27@gmail.com>
>
> diff --git a/drivers/power/gpio-charger.c b/drivers/power/gpio-charger.c
> index fccbe99..06a74f0 100644
> --- a/drivers/power/gpio-charger.c
> +++ b/drivers/power/gpio-charger.c
> @@ -87,6 +87,8 @@ static int __devinit gpio_charger_probe(struct platform_device *pdev)
> }
>
> gpio_charger = kzalloc(sizeof(*gpio_charger), GFP_KERNEL);
> + if (!gpio_charger)
> + return -ENOMEM;
>
> charger = &gpio_charger->charger;
>
Hi
This is now the 4th patch or so fixing this issue. I send the first one[1], together
with some other fixes[2][3], a month ago.
Anton could you please pick them up?
Thanks
- - Lars
[1] http://lkml.indiana.edu/hypermail/linux/kernel/1011.2/02029.html
[2] http://lkml.indiana.edu/hypermail/linux/kernel/1011.2/02028.html
[3] http://lkml.indiana.edu/hypermail/linux/kernel/1011.2/02030.html
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAk0PtuYACgkQBX4mSR26RiOCRQCfdKUdpAjX2GxAJuGVekZDiyjx
j3IAnRCS562ud3Ali/B5V1gWNeBHcxNj
=M4Vg
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [patch -next] power/gpio-charger: check for kzalloc() failure
2010-12-20 20:04 ` Lars-Peter Clausen
@ 2010-12-20 20:30 ` Dan Carpenter
-1 siblings, 0 replies; 6+ messages in thread
From: Dan Carpenter @ 2010-12-20 20:30 UTC (permalink / raw)
To: Lars-Peter Clausen; +Cc: Anton Vorontsov, linux-kernel, kernel-janitors
On Mon, Dec 20, 2010 at 09:04:54PM +0100, Lars-Peter Clausen wrote:
> This is now the 4th patch or so fixing this issue.
Haha. No one can resist the easy one liners. If I had had to kfree() a
single variable before returning then you can know for a fact I'd be too
lazy to fix it. :P
regards,
dan carpenter
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [patch -next] power/gpio-charger: check for kzalloc() failure
@ 2010-12-20 20:30 ` Dan Carpenter
0 siblings, 0 replies; 6+ messages in thread
From: Dan Carpenter @ 2010-12-20 20:30 UTC (permalink / raw)
To: Lars-Peter Clausen; +Cc: Anton Vorontsov, linux-kernel, kernel-janitors
On Mon, Dec 20, 2010 at 09:04:54PM +0100, Lars-Peter Clausen wrote:
> This is now the 4th patch or so fixing this issue.
Haha. No one can resist the easy one liners. If I had had to kfree() a
single variable before returning then you can know for a fact I'd be too
lazy to fix it. :P
regards,
dan carpenter
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-12-20 20:30 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-20 13:08 [patch -next] power/gpio-charger: check for kzalloc() failure Dan Carpenter
2010-12-20 13:08 ` Dan Carpenter
2010-12-20 20:04 ` Lars-Peter Clausen
2010-12-20 20:04 ` Lars-Peter Clausen
2010-12-20 20:30 ` Dan Carpenter
2010-12-20 20:30 ` Dan Carpenter
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.