Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp974401pxb; Wed, 6 Apr 2022 05:46:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw1LQ5J+frJnm7Elrce33dMQPH8DrqpT8PMhMuCVDZd/BURoLGB4NXFUN4jLr29xW7FIi49 X-Received: by 2002:a17:90a:7d10:b0:1c9:7939:c70 with SMTP id g16-20020a17090a7d1000b001c979390c70mr9741456pjl.203.1649249215627; Wed, 06 Apr 2022 05:46:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649249215; cv=none; d=google.com; s=arc-20160816; b=upa8aS6cIaB4HpzkWm1LkW4fZoFnWq5nm0dgA9d88Fu8bIAPZPdH7Mz4iyjdXAqLq6 BdnRWTlarLs9fSriBd62UzbGzFH1feRQPUn92rQrNgmkfLAZG4ujPgjWdig84moIHGq7 oWAETZg+4+a1pqgLZUXtXcy6pXSOtz9pdUn2X67m4X0kKt+osrjX4PzBemo2l/SQ7EXX scJ3tRG0SPQ9ZGXSiM++LTKgGx2z9U7Si5QMNqj8UpY8kcLp8wWG26m1Gz2hdnnYQzNH Jtp07GnXFFR5XdnfeBBQ2Kj8b5plrB1VbaOZ2+tWvOMH+Q3QWNHxxkm3gQOt1T+iew8y DLvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=gskmGmml2oly5FauuI327fbe+PvUsJq7rNVIzLbD/dg=; b=dtKZcLSg5zdttx5j5A1S5dH5vPar8b8OOCq/QDY82G4w62X009xlXtk+4jGYEkSxCP T9xrQZJRBvumY/jdtkqHIdFglZc4mSAH5i2Nl/TaZlnpGNwZN6JVGQJiroV9oo7ngBFX fduc1WcwaSmLfOD/GUcNimPAwWGU+J6r1wH9Dd5dzdJXWyfFlHLe3PUKKnJfSOAP2v1O p9eVsDBNI8Dr8QY1PPFvI/UZwM506DHMuDYtFPITFwGK9fWl2pFhrPbRP/tcHKkXHmBn +kBaYnpeTUZmvRcv0I2VNCblGraxaQypDn+klqUWWdcyo4RS9VgjwYepymgvOncEhEsH 58Zg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=P6zabTxV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id n9-20020a170902f60900b00153b2d164b6si15328366plg.190.2022.04.06.05.46.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 05:46:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=P6zabTxV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0776341D13C; Wed, 6 Apr 2022 02:31:55 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1588212AbiDFAOv (ORCPT + 99 others); Tue, 5 Apr 2022 20:14:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48558 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349204AbiDEJt0 (ORCPT ); Tue, 5 Apr 2022 05:49:26 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 67EB02252B; Tue, 5 Apr 2022 02:42:38 -0700 (PDT) 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 ams.source.kernel.org (Postfix) with ESMTPS id CAFF3B81C19; Tue, 5 Apr 2022 09:42:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3B418C385A3; Tue, 5 Apr 2022 09:42:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649151755; bh=coUnbwtMgy4IhV9sRORvYZJQFoFUkg3DcYgYPIf8ovE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P6zabTxVJm9pBHnFZJ+949wevXnTF4oQpAznZoIjPW9bNT1nDUTBbvyA3iL4VKar0 8QVknQGG/2RLbFQM0SGaQVnhMquNRo1WKdAHDXNOePoRfCJlZMYiOCkGSdppCjOThU 865uspWnnb3VsLe35ZTRJAbUaikeY5PHEsu9Heqo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hangyu Hua , Christophe Leroy , Michael Ellerman , Sasha Levin Subject: [PATCH 5.15 529/913] powerpc: 8xx: fix a return value error in mpc8xx_pic_init Date: Tue, 5 Apr 2022 09:26:31 +0200 Message-Id: <20220405070355.707719868@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070339.801210740@linuxfoundation.org> References: <20220405070339.801210740@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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: X-Mailing-List: linux-kernel@vger.kernel.org From: Hangyu Hua [ Upstream commit 3fd46e551f67f4303c3276a0d6cd20baf2d192c4 ] mpc8xx_pic_init() should return -ENOMEM instead of 0 when irq_domain_add_linear() return NULL. This cause mpc8xx_pics_init to continue executing even if mpc8xx_pic_host is NULL. Fixes: cc76404feaed ("powerpc/8xx: Fix possible device node reference leak") Signed-off-by: Hangyu Hua Reviewed-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220223070223.26845-1-hbh25y@gmail.com Signed-off-by: Sasha Levin --- arch/powerpc/platforms/8xx/pic.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/platforms/8xx/pic.c b/arch/powerpc/platforms/8xx/pic.c index f2ba837249d6..04a6abf14c29 100644 --- a/arch/powerpc/platforms/8xx/pic.c +++ b/arch/powerpc/platforms/8xx/pic.c @@ -153,6 +153,7 @@ int __init mpc8xx_pic_init(void) if (mpc8xx_pic_host == NULL) { printk(KERN_ERR "MPC8xx PIC: failed to allocate irq host!\n"); ret = -ENOMEM; + goto out; } ret = 0; -- 2.34.1