lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20101222000334.GA23799@oksana.dev.rtsoft.ru>
Date:	Wed, 22 Dec 2010 03:03:34 +0300
From:	Anton Vorontsov <cbouatmailru@...il.com>
To:	Lars-Peter Clausen <lars@...afoo.de>
Cc:	linux-kernel@...r.kernel.org,
	Vasiliy Kulikov <segoon@...nwall.com>,
	Dan Carpenter <error27@...il.com>
Subject: Re: [PATCH] POWER: gpio-charger: Check result of kzalloc

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@...afoo.de>
> ---

Lars, Vasiliy, Dan,

Thanks for the patch! I applied the following:

commit 2e9ff5f5e4c6b034554f3539f29529265279102c
Author: Lars-Peter Clausen <lars@...afoo.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@...afoo.de>
    Signed-off-by: Vasiliy Kulikov <segoon@...nwall.com>
    Signed-off-by: Dan Carpenter <error27@...il.com>
    Signed-off-by: Anton Vorontsov <cbouatmailru@...il.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;
 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ