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: <CACRpkdadxr5Kibap3TsVmorSJzRBdKJ=j=vwM3mM7QaGpbJhJg@mail.gmail.com>
Date:	Fri, 5 Sep 2014 10:25:03 +0200
From:	Linus Walleij <linus.walleij@...aro.org>
To:	Pramod Gurav <pramod.gurav@...rtplayin.com>
Cc:	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Jean-Christophe Plagniol-Villard <plagnioj@...osoft.com>
Subject: Re: [PATCH 3/4] pinctrl: at91: Fix error handling while doing gpiochio_irqchip_add

On Sun, Aug 31, 2014 at 1:21 PM, Pramod Gurav
<pramod.gurav@...rtplayin.com> wrote:

> This patch removes a call to panic function when gpiochio_irqchip_add
> fails and just returns the error to the calling function.
> Same return value is used to handle the error case and adds to lable
> to release resources on error.
>
> This also changes first argument to function at91_gpio_of_irq_setup from
> struct device_node to struct platform_device. Because The device_node
> argument was anyway not being used. Passed pdev so that on failure dev_err
> can use &pdev->dev and log can be associated with proper device.
>
> CC: Jean-Christophe Plagniol-Villard <plagnioj@...osoft.com>
> CC: Linus Walleij <linus.walleij@...aro.org>
> Signed-off-by: Pramod Gurav <pramod.gurav@...rtplayin.com>
(...)

> @@ -1470,9 +1470,11 @@ static int at91_gpio_of_irq_setup(struct device_node *node,
>                                    0,
>                                    handle_edge_irq,
>                                    IRQ_TYPE_EDGE_BOTH);
> -       if (ret)
> -               panic("at91_gpio.%d: couldn't allocate irq domain (DT).\n",
> +       if (ret) {
> +               dev_err(&pdev->dev, "at91_gpio.%d: couldn't allocate irq domain (DT).\n",
>                         at91_gpio->pioc_idx);
> +               return ret;
> +       }

If you're fixing this, also fix the error message. It's unable to allocate
a GPIOchip irqchip, not an irq domain. (Caused by other patch, but
please fix this if you're playing around here.)

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