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]
Date:	Wed, 03 Dec 2014 17:44:00 +0100
From:	Lars-Peter Clausen <lars@...afoo.de>
To:	Andrew Jackson <Andrew.Jackson@....com>,
	Jaroslav Kysela <perex@...ex.cz>, Takashi Iwai <tiwai@...e.de>
CC:	"alsa-devel@...a-project.org" <alsa-devel@...a-project.org>,
	Liviu Dudau <Liviu.Dudau@....com>,
	Liam Girdwood <lgirdwood@...il.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Mark Brown <broonie@...nel.org>,
	Rajeev Kumar <rajeevkumar.linux@...il.com>,
	"linux-arm-kernel@...ts.infradead.org" 
	<linux-arm-kernel@...ts.infradead.org>
Subject: Re: [alsa-devel] [PATCH 1/5] ASoC: dwc: Allocate resources with devm_ioremap_resource

On 12/03/2014 05:38 PM, Andrew Jackson wrote:
[,,,[
> +	dw_i2s_dai = devm_kzalloc(&pdev->dev, sizeof(*dw_i2s_dai), GFP_KERNEL);
> +	if (!dw_i2s_dai) {
> +		dev_err(&pdev->dev, "mem allocation failed for dai driver\n");

All the memory alloc functions already print a error message.

>   		return -ENOMEM;
>   	}
>
> +	dw_i2s_dai->ops = &dw_i2s_dai_ops;
> +	dw_i2s_dai->suspend = dw_i2s_suspend;
> +	dw_i2s_dai->resume = dw_i2s_resume;

This seems to be separate from the devm_ioremap_resource() change.

> +
> +	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> +	if (!res) {

You don't actually have to check it devm_ioremap_resource does this for you.

> +		dev_err(&pdev->dev, "no i2s resource defined\n");
> +		return -ENODEV;
> +	}
> +
> +	dev->i2s_base = devm_ioremap_resource(&pdev->dev, res);
> +	if (IS_ERR(dev->i2s_base)) {
> +		dev_err(&pdev->dev, "ioremap fail for i2s_region\n");

Same here devm_ioremap_resource() will already print a appropriate error 
message.

> +		return PTR_ERR(dev->i2s_base);
> +	}

--
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