From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A92521ED38 for ; Tue, 25 Jul 2023 11:33:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 29D38C433C7; Tue, 25 Jul 2023 11:33:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1690284802; bh=sHtE15PecU2QpaCoVfQN+PYWLcVMakYcm1Moz9PpAqY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yl6Z2jVTE6oik6DHGMMIWNziGv9zEHwOf6C84g1lFcp4UF8xRnrBvtLRXFHK6OlAJ QzLp1aMXdrJYsiVRxUtKMi0KbbAcX6CL2sBbmMIPAz4ER4xNvHCGBWMhyp14Efbj06 WKZcGaRI0NKaP19/Dj7N93kuv+bY4XQoBE3eNozs= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Zhang Shurong , Helge Deller , Sasha Levin Subject: [PATCH 5.10 486/509] fbdev: au1200fb: Fix missing IRQ check in au1200fb_drv_probe Date: Tue, 25 Jul 2023 12:47:05 +0200 Message-ID: <20230725104615.979528402@linuxfoundation.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230725104553.588743331@linuxfoundation.org> References: <20230725104553.588743331@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Zhang Shurong [ Upstream commit 4e88761f5f8c7869f15a2046b1a1116f4fab4ac8 ] 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 Signed-off-by: Helge Deller Signed-off-by: Sasha Levin --- drivers/video/fbdev/au1200fb.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/video/fbdev/au1200fb.c b/drivers/video/fbdev/au1200fb.c index a8a0a448cdb5e..80f54111baec1 100644 --- a/drivers/video/fbdev/au1200fb.c +++ b/drivers/video/fbdev/au1200fb.c @@ -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) { -- 2.39.2