Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp707807pxb; Tue, 5 Apr 2022 19:41:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy05xwD7KsT+S2bynbmkwfXZo459MPBAO8D9YAqbez3iRRuSJ63BPg/xUeLm4RLV0OEMDpE X-Received: by 2002:a17:902:ba8c:b0:14f:d9b7:ab4 with SMTP id k12-20020a170902ba8c00b0014fd9b70ab4mr6467207pls.23.1649212870862; Tue, 05 Apr 2022 19:41:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649212870; cv=none; d=google.com; s=arc-20160816; b=Gt9vwqvOZL2PwWJWxVtLaI3XoJN+9nu+QVgQpgbdfwztGXGpX+htaA6unjEq0bB8Dh TqaHq3F9WxmowhE3ZBpiiRxrjC+zln8NGKs50jHxVh1HmeEelApXkJ0SgSWOKmpmUp8D Db6V8BIoF2EawOo0tfRC+O5ldp4o36NGIdp29lQfk8vicdOsiX9dhmgRQOiEUF18dlDA aklPUAtmI9h3NK4aZAfrQGI/x41qZs4n+EEKPMwUqC81gHHh9RzryxOrU7f8qxpw4/TP KcCVnj8BGDZ3dgYRslwbRe1V60dnXzSEo2eMD+nT9PSho4yfOhpp428WtDrtUvnFixk2 IcLg== 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=ACmGQV1/Bw1sxGx1XQhyq6L0hTO6lWAIx/vAmXDIvX5Abs/KbrsNTlGO55X7fCT+Az It2exYmW2ehyWrqGkMJhTTN0o0tMbGykpuHYMdPRaQaCyMDALqQp8Tw5NcrTdBb2Q7DZ O2RkXmpTQaHob+0TXi95O55Kk5xu/iKe/Dyi6hfZFNKXdmZRyeF13/YDcBVDmcFOR3cH XzXP4ezKRxapzs+HfUCShOclBbjo1ESWAT5agmJkMUfpZyEcVs673yJZz3RWPSqdIZaS 51y5tmgErJVLqzG3yP0C/ME0xrCmN+TABUSa+dAup4Qozajixw6xZnDynNaiyx+iEdGp JO4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=F5wUXmff; 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=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m13-20020a170902f64d00b00153b2d165d2si14106727plg.474.2022.04.05.19.40.56; Tue, 05 Apr 2022 19:41:10 -0700 (PDT) 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=@linuxfoundation.org header.s=korg header.b=F5wUXmff; 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=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238825AbiDEJFa (ORCPT + 99 others); Tue, 5 Apr 2022 05:05:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34814 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238264AbiDEISq (ORCPT ); Tue, 5 Apr 2022 04:18:46 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 21D7C107; Tue, 5 Apr 2022 01:08:30 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 8B51F608C0; Tue, 5 Apr 2022 08:08:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9305CC385A0; Tue, 5 Apr 2022 08:08:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649146110; bh=coUnbwtMgy4IhV9sRORvYZJQFoFUkg3DcYgYPIf8ovE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=F5wUXmffXJ9QonZE/9NEM/9INI4IE5W57GRbkiLOCYKo9fIckrBAHcX4pnQx325Lm QPlJ4QAj9+i6aB1Pmke2SH168LtGtc/JfgoEKe1RuZehLvlXsYBqJN8GBvOiowQ+ys i7+7K6XZbJtKG84J7mO1iiYdXp1TV1FaX1ZeweIU= 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.17 0647/1126] powerpc: 8xx: fix a return value error in mpc8xx_pic_init Date: Tue, 5 Apr 2022 09:23:14 +0200 Message-Id: <20220405070426.622989226@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070407.513532867@linuxfoundation.org> References: <20220405070407.513532867@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=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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: 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