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]
Message-ID: <CAK8P3a2D1eks7dirbX=LrdQy6w0HeA7-x8jb1=qkxfatPuc51w@mail.gmail.com>
Date:   Fri, 15 Nov 2019 10:12:57 +0100
From:   Arnd Bergmann <arnd@...db.de>
To:     Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc:     Lee Jones <lee.jones@...aro.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v1 2/2] mfd: syscon: Switch to use devm_ioremap_resource()

On Fri, Nov 15, 2019 at 9:49 AM Andy Shevchenko
<andriy.shevchenko@...ux.intel.com> wrote:
>
> Instead of checking resource pointer for being NULL and
> report some not very standard error codes in this case,
> switch to devm_ioremap_resource() API.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>

IIRC there are some slightly odd uses of syscon that rely on on us not calling
devm_request_mem_region here, which is implied by devm_ioremap_resource()
but not devm_ioremap().

A patch to add a comment about this might be helpful though.

    Arnd

> ---
>  drivers/mfd/syscon.c | 9 +++------
>  1 file changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/mfd/syscon.c b/drivers/mfd/syscon.c
> index 13626bb2d432..fad961b2e4a5 100644
> --- a/drivers/mfd/syscon.c
> +++ b/drivers/mfd/syscon.c
> @@ -238,12 +238,9 @@ static int syscon_probe(struct platform_device *pdev)
>                 return -ENOMEM;
>
>         res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -       if (!res)
> -               return -ENOENT;
> -
> -       base = devm_ioremap(dev, res->start, resource_size(res));
> -       if (!base)
> -               return -ENOMEM;
> +       base = devm_ioremap_resource(dev, res);
> +       if (IS_ERR(base))
> +               return PTR_ERR(base);
>
>         syscon_config.max_register = resource_size(res) - 4;
>         if (pdata)
> --
> 2.24.0
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ