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] [day] [month] [year] [list]
Message-ID: <CAJKOXPc37f1vRDXjw6fmS5UArVFZ1dDup8Pq9o-mCN0V2ga43w@mail.gmail.com>
Date:   Thu, 27 Aug 2020 09:28:56 +0200
From:   Krzysztof Kozlowski <krzk@...nel.org>
To:     Jassi Brar <jassisinghbrar@...il.com>,
        Matthias Brugger <matthias.bgg@...il.com>,
        Houlong Wei <houlong.wei@...iatek.com>,
        HS Liao <hs.liao@...iatek.com>, CK Hu <ck.hu@...iatek.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        linux-arm-kernel@...ts.infradead.org,
        linux-mediatek@...ts.infradead.org
Subject: Re: [PATCH] maiblox: mediatek: Fix handling of platform_get_irq() error

On Thu, 27 Aug 2020 at 09:26, Krzysztof Kozlowski <krzk@...nel.org> wrote:
>
> platform_get_irq() returns -ERRNO on error.  In such case comparison
> to 0 would pass the check.
>
> Fixes: 623a6143a845 ("mailbox: mediatek: Add Mediatek CMDQ driver")
> Signed-off-by: Krzysztof Kozlowski <krzk@...nel.org>
> ---
>  drivers/mailbox/mtk-cmdq-mailbox.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/mailbox/mtk-cmdq-mailbox.c b/drivers/mailbox/mtk-cmdq-mailbox.c
> index 484d4438cd83..76e4dfcf5228 100644
> --- a/drivers/mailbox/mtk-cmdq-mailbox.c
> +++ b/drivers/mailbox/mtk-cmdq-mailbox.c
> @@ -525,10 +525,8 @@ static int cmdq_probe(struct platform_device *pdev)
>         }
>
>         cmdq->irq = platform_get_irq(pdev, 0);
> -       if (!cmdq->irq) {
> -               dev_err(dev, "failed to get irq\n");
> -               return -EINVAL;
> -       }
> +       if (!cmdq->irq < 0)

Ah, this is wrong. The irq is u32... without my patch this was so broken...

Best regards,
Krzysztof

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ