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:	Tue, 23 Jul 2013 11:25:25 -0700
From:	Joe Perches <joe@...ches.com>
To:	Wolfram Sang <wsa@...-dreams.de>
Cc:	linux-kernel@...r.kernel.org,
	Stephen Warren <swarren@...dotorg.org>,
	linux-tegra@...r.kernel.org
Subject: Re: [PATCH 10/27] drivers/memory: don't check resource with
 devm_ioremap_resource

On Tue, 2013-07-23 at 20:01 +0200, Wolfram Sang wrote:
> devm_ioremap_resource does sanity checks on the given resource. No need to
> duplicate this in the driver.

Hi Wolfram:

This is the first and only one of the patch series I looked at.

> diff --git a/drivers/memory/tegra20-mc.c b/drivers/memory/tegra20-mc.c
[]
> @@ -218,8 +218,6 @@ static int tegra20_mc_probe(struct platform_device *pdev)
>  		struct resource *res;
>  
>  		res = platform_get_resource(pdev, IORESOURCE_MEM, i);
> -		if (!res)
> -			return -ENODEV;
>  		mc->regs[i] = devm_ioremap_resource(&pdev->dev, res);

I'm not so sure this is appropriate.

devm_ioremap_resource returns ERR_PTR(-EINVAL) for
null resource so this changes the return.

devm_ioremap_resource also emits a noisy dev_err
message when resource is NULL.

It's a probe and before the message log would be silent
but now there's a new dmesg.

Perhaps that should be mentioned in the changelog here
and elsewhere in the series.


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