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: <CAAOTY_9jC2CMws-xoRgLmcHY=4f1EbLaFRkjAPsC18rrWn12jQ@mail.gmail.com>
Date:   Sat, 3 Oct 2020 11:26:05 +0800
From:   Chun-Kuang Hu <chunkuang.hu@...nel.org>
To:     Krzysztof Kozlowski <krzk@...nel.org>
Cc:     Jassi Brar <jassisinghbrar@...il.com>,
        Matthias Brugger <matthias.bgg@...il.com>,
        CK Hu <ck.hu@...iatek.com>, HS Liao <hs.liao@...iatek.com>,
        Houlong Wei <houlong.wei@...iatek.com>,
        linux-kernel <linux-kernel@...r.kernel.org>,
        Linux ARM <linux-arm-kernel@...ts.infradead.org>,
        "moderated list:ARM/Mediatek SoC support" 
        <linux-mediatek@...ts.infradead.org>,
        Frank Wunderlich <frank-w@...lic-files.de>
Subject: Re: [PATCH v3] mailbox: mediatek: Fix handling of platform_get_irq() error

Krzysztof Kozlowski <krzk@...nel.org> 於 2020年8月28日 週五 上午2:25寫道:
>
> platform_get_irq() returns -ERRNO on error.  In such case casting to u32
> and comparing to 0 would pass the check.
>

Reviewed-by: Chun-Kuang Hu <chunkuang.hu@...nel.org>

> Fixes: 623a6143a845 ("mailbox: mediatek: Add Mediatek CMDQ driver")
> Signed-off-by: Krzysztof Kozlowski <krzk@...nel.org>
>
> ---
>
> Changes since v2:
> 1. Fix subject.
>
> Changes since v1:
> 1. Correct u32->int,
> 2. Fix left-over '!'.
> ---
>  drivers/mailbox/mtk-cmdq-mailbox.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/mailbox/mtk-cmdq-mailbox.c b/drivers/mailbox/mtk-cmdq-mailbox.c
> index 484d4438cd83..5665b6ea8119 100644
> --- a/drivers/mailbox/mtk-cmdq-mailbox.c
> +++ b/drivers/mailbox/mtk-cmdq-mailbox.c
> @@ -69,7 +69,7 @@ struct cmdq_task {
>  struct cmdq {
>         struct mbox_controller  mbox;
>         void __iomem            *base;
> -       u32                     irq;
> +       int                     irq;
>         u32                     thread_nr;
>         u32                     irq_mask;
>         struct cmdq_thread      *thread;
> @@ -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)
> +               return cmdq->irq;
>
>         plat_data = (struct gce_plat *)of_device_get_match_data(dev);
>         if (!plat_data) {
> --
> 2.17.1
>
>
> _______________________________________________
> Linux-mediatek mailing list
> Linux-mediatek@...ts.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-mediatek

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ