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 53AF31FA6 for ; Wed, 9 Aug 2023 11:09:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C78BEC433C8; Wed, 9 Aug 2023 11:09:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1691579372; bh=5CJc6/eZqUP61Yq9eiHGiTKvxNnhZJs6E42OX+mnhdw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dkN/k3HnvYfbBtrDy2uXhdK0TfcTE88edkQjoMSSyXowBALSSAZKVOPWe3zysJp8/ jBiYbQ63CfOLTAtS6DKpPrDEHbJ990jW5Xg98cpKYk+MTe8SBorVtc7XT3pcu5Fq9J 5PgpdF6E847jVOxnSJHNM4J92DZPuCYlpsMQUoVM= 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 4.14 141/204] fbdev: au1200fb: Fix missing IRQ check in au1200fb_drv_probe Date: Wed, 9 Aug 2023 12:41:19 +0200 Message-ID: <20230809103647.305576922@linuxfoundation.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230809103642.552405807@linuxfoundation.org> References: <20230809103642.552405807@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 e17a083f849ad..cae4a04cba48e 100644 --- a/drivers/video/fbdev/au1200fb.c +++ b/drivers/video/fbdev/au1200fb.c @@ -1748,6 +1748,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