[irqchip:,irq/irqchip-next] irqchip/loongson-pch-pic: Fix translate callback for DT path
Message ID | 166946968386.4906.165635954561473495.tip-bot2@tip-bot2 |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp4646224wrr; Sat, 26 Nov 2022 06:03:55 -0800 (PST) X-Google-Smtp-Source: AA0mqf4kSHDfEbvX/6hEgr9xiUiJ9YqHFR0RnDqTVaAIBLzOwcB5MNkusbq1VIHP+l0yaESwL2bc X-Received: by 2002:a17:90a:b296:b0:218:8759:f159 with SMTP id c22-20020a17090ab29600b002188759f159mr41915560pjr.32.1669471434906; Sat, 26 Nov 2022 06:03:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669471434; cv=none; d=google.com; s=arc-20160816; b=Uhm318su/VZYrLVk6gx2+MIhRp2SkaW/ih9sIUAwxt9Axa3VRfCSDCGCrwKhrBbaN6 3TVhjOaICg9EaBioqYo+TYarO5wY7Zw+bh7Uacai3XBPPwFfX5ggmKWn7WkbCktxqC0o PMSloAlyQStjtuBZqIgXGdH44jUG2Eev/V3G3opkaZJnYgc9y+6ejBvLo+xBjKkjIHdu N8yO9Wl+2Qyd8O9MQro4OFidVTc4uKjlqg4mdkjOC5RUxAuIn7I+iwdeshs0YgoJBXmv 4lmgpvy5BpFGG87/5MYb9jmo0dDYdLYxM5VIzG3q2rQM4MuKaxDSB1MQRGYFucyGFToH 672w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=wRSgG0kiOlTr5n2RtTAcIHAn15ie11sILlgqGJCYQMY=; b=IpEJmxAIk3N13jM30f1GJ3DcFqR4F7Edjc3azmQFCV1+kWmTU60d5R6hSORO3H4spr NlWNi1ARnlk/y/VQO8n4I/9SqLld4Z8kwmSHB4ABOBtXnIVCtUTdtcYP2WfSBMQtTifL wgghEfSsQKnTgExh6ySHvKt0LOK3U5Zu9K3W9apf3Lf1AVCz9FvPMmpKwwWcyC+4v3K6 +XVeGlwbWFsiWnuBnZJjv0yzkxIbP1kXwPtvRFvf7LqcjEXXsGPb6TSlYPogil08HNG3 +lsKnqRao+y7Bhw3TDubulsDg7Qu6088Y2KJC5UwRpThzyE3V/6ibv+8wb8fuJkDTMwq kvnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=s8ybBptC; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=QMhyVVnv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ng6-20020a17090b1a8600b00202c7f4631esi8993140pjb.19.2022.11.26.06.03.41; Sat, 26 Nov 2022 06:03:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=s8ybBptC; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=QMhyVVnv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229681AbiKZNfg (ORCPT <rfc822;zxc52fgh@gmail.com> + 99 others); Sat, 26 Nov 2022 08:35:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35792 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229735AbiKZNfL (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sat, 26 Nov 2022 08:35:11 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 74F5721255 for <linux-kernel@vger.kernel.org>; Sat, 26 Nov 2022 05:34:46 -0800 (PST) Date: Sat, 26 Nov 2022 13:34:43 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1669469685; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wRSgG0kiOlTr5n2RtTAcIHAn15ie11sILlgqGJCYQMY=; b=s8ybBptCPDwrmWAyjdt+d3/aJN3WrtpSTR9ECJC5wJXHWuAOhknw9+GXtJicI2R96Zx343 gCPj97A7OZF8fhyinT1IpFtv+Td+NL14yIYB+C2vYYm5+isIXIRWirpKbRRfgvgyBrlpU1 3GjanMe20RMDILUBsYnideMcE3c4uSSdSOhuOJX4sDZDr3HYFWqFa5mKGf3Uae69GU5jTk sYEk1GlrBF6bEYWORddgy78esAanCJGHg8Hw+BQWWEP5yXLUT1n0gMa2cFbUIDWgr8y+gc AayBpWSdG6JcHF6GVrTptf52Qs68zTwwfs8afDO/mKzdCVHXS+OwEqoyvTWWMA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1669469685; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wRSgG0kiOlTr5n2RtTAcIHAn15ie11sILlgqGJCYQMY=; b=QMhyVVnvcrl0tcjdtrlwjdZrnyAaPUXNuhsGu8efofEvZz7evCzEeK41DMzXuJpkckr7h3 fMpQht1qwOgW8rBw== From: "irqchip-bot for Jianmin Lv" <tip-bot2@linutronix.de> Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-kernel@vger.kernel.org Subject: [irqchip: irq/irqchip-next] irqchip/loongson-pch-pic: Fix translate callback for DT path Cc: Jianmin Lv <lvjianmin@loongson.cn>, Huacai Chen <chenhuacai@loongson.cn>, Marc Zyngier <maz@kernel.org>, tglx@linutronix.de In-Reply-To: <20221022075955.11726-3-lvjianmin@loongson.cn> References: <20221022075955.11726-3-lvjianmin@loongson.cn> MIME-Version: 1.0 Message-ID: <166946968386.4906.165635954561473495.tip-bot2@tip-bot2> Robot-ID: <tip-bot2@linutronix.de> Robot-Unsubscribe: Contact <mailto:tglx@linutronix.de> to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750567679358706811?= X-GMAIL-MSGID: =?utf-8?q?1750567679358706811?= |
Series |
[irqchip:,irq/irqchip-next] irqchip/loongson-pch-pic: Fix translate callback for DT path
|
|
Commit Message
tip-bot2 for Thomas Gleixner
Nov. 26, 2022, 1:34 p.m. UTC
The following commit has been merged into the irq/irqchip-next branch of irqchip: Commit-ID: c7c00138015975c8f0e268564249cc47d8de632c Gitweb: https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms/c7c00138015975c8f0e268564249cc47d8de632c Author: Jianmin Lv <lvjianmin@loongson.cn> AuthorDate: Sat, 22 Oct 2022 15:59:53 +08:00 Committer: Marc Zyngier <maz@kernel.org> CommitterDate: Sat, 26 Nov 2022 13:05:38 irqchip/loongson-pch-pic: Fix translate callback for DT path In DT path of translate callback, if fwspec->param_count==1 and of_node is non-null, fwspec->param[1] will be accessed, which is introduced from previous commit bcdd75c596c8 (irqchip/loongson-pch-pic: Add ACPI init support). Before the patch, for non-null of_node, translate callback (use irq_domain_translate_twocell()) will return -EINVAL if fwspec->param_count < 2, so the check in the patch is added. Fixes: bcdd75c596c8 ("irqchip/loongson-pch-pic: Add ACPI init support") Signed-off-by: Jianmin Lv <lvjianmin@loongson.cn> Reviewed-by: Huacai Chen <chenhuacai@loongson.cn> Signed-off-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20221022075955.11726-3-lvjianmin@loongson.cn --- drivers/irqchip/irq-loongson-pch-pic.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/drivers/irqchip/irq-loongson-pch-pic.c b/drivers/irqchip/irq-loongson-pch-pic.c index c01b9c2..03493cd 100644 --- a/drivers/irqchip/irq-loongson-pch-pic.c +++ b/drivers/irqchip/irq-loongson-pch-pic.c @@ -159,6 +159,9 @@ static int pch_pic_domain_translate(struct irq_domain *d, return -EINVAL; if (of_node) { + if (fwspec->param_count < 2) + return -EINVAL; + *hwirq = fwspec->param[0] + priv->ht_vec_base; *type = fwspec->param[1] & IRQ_TYPE_SENSE_MASK; } else {