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] [day] [month] [year] [list]
Date:   Sun, 23 Apr 2017 21:44:33 +0200
From:   Pali Rohár <pali.rohar@...il.com>
To:     Pan Bian <bianpan2016@....com>
Cc:     Sebastian Reichel <sre@...nel.org>, linux-pm@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/1] power: check return value of devm_kzalloc

On Sunday 23 April 2017 11:03:56 Pan Bian wrote:
>  		pdata = devm_kzalloc(&pdev->dev,
>  			sizeof(struct isp1704_charger_data), GFP_KERNEL);
> +		if (!pdata)
> +			return -ENOMEM;
>  		pdata->enable_gpio = gpio;
> 
>  		dev_info(&pdev->dev, "init gpio %d\n", pdata->enable_gpio);

What about calling "goto fail0", so there will be error message about 
failure of registering isp1704 like for any other failures?

-- 
Pali Rohár
pali.rohar@...il.com

Download attachment "signature.asc " of type "application/pgp-signature" (199 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ