From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A0547C74A5B for ; Fri, 10 Mar 2023 15:10:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233960AbjCJPKk (ORCPT ); Fri, 10 Mar 2023 10:10:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233959AbjCJPKV (ORCPT ); Fri, 10 Mar 2023 10:10:21 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3168312D430 for ; Fri, 10 Mar 2023 07:02:39 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 6F17C61962 for ; Fri, 10 Mar 2023 15:02:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7D2C7C433D2; Fri, 10 Mar 2023 15:02:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1678460550; bh=gj2NPqzvJg5aXfw4NfVzJoiRNI9hw8LOJqW3Ml6V2cc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YHNPZUX+nR/COvRDy0mkw2nh7s/CAkRQFDKC9td6qYH4zvcV1JP/RvMDnKykHDoDX ihR6Jxho9e3pjMdLTu9Osh4Axi+xaMpMhrBU/mer+DJXD63tLv6pVtw9ISWm0AvhYs sFHZ27SQlHwgFP06nVSscVAqcIbk++26fV5mtcns= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Hsin-Yi Wang , Mark-PK Tsai , Johan Hovold , Marc Zyngier Subject: [PATCH 5.10 372/529] irqdomain: Drop bogus fwspec-mapping error handling Date: Fri, 10 Mar 2023 14:38:35 +0100 Message-Id: <20230310133822.227647967@linuxfoundation.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230310133804.978589368@linuxfoundation.org> References: <20230310133804.978589368@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Johan Hovold commit e3b7ab025e931accdc2c12acf9b75c6197f1c062 upstream. In case a newly allocated IRQ ever ends up not having any associated struct irq_data it would not even be possible to dispose the mapping. Replace the bogus disposal with a WARN_ON(). This will also be used to fix a shared-interrupt mapping race, hence the CC-stable tag. Fixes: 1e2a7d78499e ("irqdomain: Don't set type when mapping an IRQ") Cc: stable@vger.kernel.org # 4.8 Tested-by: Hsin-Yi Wang Tested-by: Mark-PK Tsai Signed-off-by: Johan Hovold Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20230213104302.17307-4-johan+linaro@kernel.org Signed-off-by: Greg Kroah-Hartman --- kernel/irq/irqdomain.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) --- a/kernel/irq/irqdomain.c +++ b/kernel/irq/irqdomain.c @@ -837,13 +837,8 @@ unsigned int irq_create_fwspec_mapping(s } irq_data = irq_get_irq_data(virq); - if (!irq_data) { - if (irq_domain_is_hierarchy(domain)) - irq_domain_free_irqs(virq, 1); - else - irq_dispose_mapping(virq); + if (WARN_ON(!irq_data)) return 0; - } /* Store trigger type */ irqd_set_trigger_type(irq_data, type);