Commit 0ef3857a authored by Zhang Shurong's avatar Zhang Shurong Committed by sanglipeng
Browse files

fbdev: au1200fb: Fix missing IRQ check in au1200fb_drv_probe

stable inclusion
from stable-v5.10.188
commit 49e435ca02c797e6e877bb79a9c3c3f580462fdb
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I8KYFP

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=49e435ca02c797e6e877bb79a9c3c3f580462fdb



--------------------------------

[ Upstream commit 4e88761f ]

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: 1630d85a ("au1200fb: fix hardcoded IRQ")
Signed-off-by: default avatarZhang Shurong <zhang_shurong@foxmail.com>
Signed-off-by: default avatarHelge Deller <deller@gmx.de>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarsanglipeng <sanglipeng1@jd.com>
parent 68c90dba
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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) {