]> git.dujemihanovic.xyz Git - linux.git/commitdiff
fbdev: au1200fb: Fix missing IRQ check in au1200fb_drv_probe
authorZhang Shurong <zhang_shurong@foxmail.com>
Sat, 15 Jul 2023 08:16:56 +0000 (16:16 +0800)
committerHelge Deller <deller@gmx.de>
Thu, 20 Jul 2023 05:52:54 +0000 (07:52 +0200)
This func misses checking for platform_get_irq()'s call and may passes the
negative error codes to request_irq(), which takes unsigned IRQ #,
causing it to fail with -EINVAL, overriding an original error code.

Fix this by stop calling request_irq() with invalid IRQ #s.

Fixes: 1630d85a8312 ("au1200fb: fix hardcoded IRQ")
Signed-off-by: Zhang Shurong <zhang_shurong@foxmail.com>
Signed-off-by: Helge Deller <deller@gmx.de>
drivers/video/fbdev/au1200fb.c

index 5c232eb137247ba6d454a8024b1dc62fd5689266..c137d6afe4840cea10fd7a6b8fb6ad839ca7007b 100644 (file)
@@ -1732,6 +1732,9 @@ static int au1200fb_drv_probe(struct platform_device *dev)
 
        /* Now hook interrupt too */
        irq = platform_get_irq(dev, 0);
+       if (irq < 0)
+               return irq;
+
        ret = request_irq(irq, au1200fb_handle_irq,
                          IRQF_SHARED, "lcd", (void *)dev);
        if (ret) {