Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1629070

Re: [PATCH 1/1] power: check return value of devm_kzalloc

From Pali Rohár <pali.rohar@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH 1/1] power: check return value of devm_kzalloc
Date 2017-04-23 21:50 +0200
Message-ID <tzvG9-4lo-5@gated-at.bofh.it> (permalink)
References <tzlGN-6uj-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

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@gmail.com

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH 1/1] power: check return value of devm_kzalloc Pan Bian <bianpan2016@163.com> - 2017-04-23 11:10 +0200
  Re: [PATCH 1/1] power: check return value of devm_kzalloc Pali Rohár <pali.rohar@gmail.com> - 2017-04-23 21:50 +0200

csiph-web