[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <201704232144.33603@pali>
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