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 A609EC4332F for ; Fri, 18 Nov 2022 12:15:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235212AbiKRMPx (ORCPT ); Fri, 18 Nov 2022 07:15:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229476AbiKRMPt (ORCPT ); Fri, 18 Nov 2022 07:15:49 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 379898433E; Fri, 18 Nov 2022 04:15:48 -0800 (PST) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1668773746; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=KbhC+CeOnQyJado2rlUErrgQRP0kTDr+v7gOg9BPMlA=; b=020atVsyMLfolWBiYY38Feh3nJrkY9r32xCdjepoHGTdP+8iC/MiCsVWps1h1Q6dCOPd0V 3dRyC/HX5/IsS84pv78SBBwI/59zF/onT4/sOywjPEZgNEhczCb1RgmIh2H8DG2u+xzWu9 jesRPEWmTvzZyMncjclTqMu6tWsTYceEQIol+X9YYXiPZDmdDoGDGznuy6zPKpRnEmy3vB VG2c2IJ6jlZG5yCMZu2be7uQxvJRYv+88IWB3EfpoCAuyVojD1x4saB7dOpO9K0zr/+oy+ bxZSkBlRlsu8cXuZ0fs8gW+PckjldhsEG5fGDNU4+KukgXGGMyx5IaaCcDufdA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1668773746; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=KbhC+CeOnQyJado2rlUErrgQRP0kTDr+v7gOg9BPMlA=; b=jEIHVfw7ZE92bK+yriuOZSMTdYskff83TpusIBX/kEnzgq8aqxSrUqjyVKwcXlrq7ZZhKc HE5daoQTXiaM67DQ== To: "Tian, Kevin" , LKML Cc: "x86@kernel.org" , Joerg Roedel , Will Deacon , "linux-pci@vger.kernel.org" , Bjorn Helgaas , Lorenzo Pieralisi , Marc Zyngier , Greg Kroah-Hartman , Jason Gunthorpe , "Jiang, Dave" , Alex Williamson , "Williams, Dan J" , Logan Gunthorpe , "Raj, Ashok" , Jon Mason , Allen Hubbe , "Ahmed S. Darwish" , "Chatre, Reinette" Subject: RE: [patch 06/20] genirq/msi: Check for invalid MSI parent domain usage In-Reply-To: References: <20221111131813.914374272@linutronix.de> <20221111132706.388892782@linutronix.de> Date: Fri, 18 Nov 2022 13:15:45 +0100 Message-ID: <87tu2wjw5q.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 18 2022 at 07:50, Kevin Tian wrote: >> From: Thomas Gleixner >> Sent: Friday, November 11, 2022 9:57 PM >> >> @@ -937,13 +937,21 @@ int msi_domain_alloc_irqs_descs_locked(s >> >> lockdep_assert_held(&dev->msi.data->mutex); >> >> + if (WARN_ON_ONCE(irq_domain_is_msi_parent(domain))) { >> + ret = -EINVAL; >> + goto free; >> + } >> + >> + /* Frees allocated descriptors in case of failure. */ >> ret = msi_domain_add_simple_msi_descs(info, dev, nvec); >> if (ret) >> return ret; > > it's unusual to see a direct return when error unwind is already required > at an early failure point. is it something which can be improved here? It's redundant in this case, but you are right it looks weird.