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: <CACRpkdYbCmt_QsfzmSrK7YssHVKZH=dbBCcCmU67Hr9iNxQO-g@mail.gmail.com>
Date:	Thu, 16 Jul 2015 15:52:19 +0200
From:	Linus Walleij <linus.walleij@...aro.org>
To:	Krzysztof Kozlowski <k.kozlowski.k@...il.com>,
	Rabin Vincent <rabin@....in>
Cc:	Alexandre Courbot <gnurou@...il.com>,
	"linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	stable <stable@...r.kernel.org>
Subject: Re: [RFT PATCH] gpio: etraxfs: Fix devm_ioremap_resource return value check

On Thu, Jul 9, 2015 at 3:19 PM, Krzysztof Kozlowski
<k.kozlowski.k@...il.com> wrote:

> Value returned by devm_ioremap_resource() was checked for non-NULL but
> devm_ioremap_resource() returns IOMEM_ERR_PTR, not NULL. In case of
> error this could lead to dereference of ERR_PTR.
>
> Signed-off-by: Krzysztof Kozlowski <k.kozlowski.k@...il.com>
> Fixes: d342571efea8 ("gpio: add ETRAXFS GPIO driver")
> Cc: <stable@...r.kernel.org>
>
> ---
>
> Patch only compile tested.
> ---
>  drivers/gpio/gpio-etraxfs.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpio/gpio-etraxfs.c b/drivers/gpio/gpio-etraxfs.c
> index 28071f4a5672..0e643140efde 100644
> --- a/drivers/gpio/gpio-etraxfs.c
> +++ b/drivers/gpio/gpio-etraxfs.c
> @@ -117,8 +117,8 @@ static int etraxfs_gpio_probe(struct platform_device *pdev)
>
>         res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>         regs = devm_ioremap_resource(dev, res);
> -       if (!regs)
> -               return -ENOMEM;
> +       if (IS_ERR(regs))
> +               return PTR_ERR(regs);
>
>         match = of_match_node(etraxfs_gpio_of_table, dev->of_node);
>         if (!match)

Rabin, can you ACK this?

Yours,
Linus Walleij
--
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