Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3473209rwa; Tue, 23 Aug 2022 05:27:48 -0700 (PDT) X-Google-Smtp-Source: AA6agR56GX7GaKyxnUNcdJXkaUnhjbUafgf7Jak2FY4PrSc827og+1Ok+dvepsvCqlyB7Kyn7Y8r X-Received: by 2002:a05:6a02:205:b0:41b:96dc:bb2a with SMTP id bh5-20020a056a02020500b0041b96dcbb2amr20696211pgb.116.1661257667979; Tue, 23 Aug 2022 05:27:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661257667; cv=none; d=google.com; s=arc-20160816; b=k/dZRt3Zr7Jjm1ZN7kIribEUuRNkOWHpdYq9m/CDOX9V7BwsAfr4pp2DRlTzGAk/VC x2DPRPNqvN8KJ2OHuv1LbuNK89rwNlDrBcjoDUNB9Vy8mM7FhavjdfB6zCSDl4E3de6M LfkeKUDhuwFIxGq3lFOxZPAIBBmCYBklK+tUXKRT3YvoClJFtXpu9U17PFhVgwnLlo11 F035IFZKaJLkgaTOMbk3LzQ0R2Z632PgF0rZO0XyUhFXU1WUNd9+g0vYVwx7GhGi/+3l u3UL7PJJ5sgN2XeSQZwj67zwM7uytcjAgVqGk3SlRRzSjr7ZtMIOODSD1lZ64h3BX7Wo 8aDg== 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=qj/e1oojFforVIvppTVBXA4FyukWxvYsPtnbrfJAYOc=; b=yYjmjxg3wE+lIqYQKDSst7J1zvPLX+9SF1UxwZq7dIQRuFgoDW6Zvqqr+FeaNRWSjA kynXyHncf4wUrkJ1qls23VMNynEiEfaDy7og2yfYENOTsXK1tfJtzKwwSHgiKMwhqg4a TM5eglVrnWfhM7cFz7SuFCH1uqaUZZwZXMHQb3/XhMOUqPQDQS2NZRCcGz+oRIXk9vDy Fgm+VJOqiIzJfeX1vINNh9tvmIHQTYKAArxneIchWNeNZlq2Z3cHLexMaKyST9Ive93v +m0jI8Eb8dEccdvnsg3WUM61YJ7/3Pluz3QKmLyBIjBesHR8tpE5irBidRutIuGIzwIU YB0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="jUJym/Mo"; 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 k6-20020a628406000000b00536268c3311si11795080pfd.101.2022.08.23.05.27.36; Tue, 23 Aug 2022 05:27:47 -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="jUJym/Mo"; 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 S1352050AbiHWKBK (ORCPT + 99 others); Tue, 23 Aug 2022 06:01:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352382AbiHWJ4v (ORCPT ); Tue, 23 Aug 2022 05:56:51 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A689BA1A59; Tue, 23 Aug 2022 01:47:33 -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 21C376155E; Tue, 23 Aug 2022 08:47:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 213C5C433C1; Tue, 23 Aug 2022 08:47:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661244450; bh=PYhSPsobpJ6kkl+Qsx5f0HgJelQ0xIq3RmooO9CvX2I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jUJym/ModyYir2k1KqEWiEY4UP2fdakpTc2z5dyHj8qqjNWoqeHUfkhj40blHyto/ 8FPH0lltya8FV3cUyuMuR5K7DH3ByHtj/V4uZBTctp+M2t/qBTwCAaH4MHZgXprQvZ RRQQZIWz2RP1AXAV1qIywL4PJx7N/b2Dmu07JzB8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Michael Ellerman , Sasha Levin Subject: [PATCH 4.14 139/229] powerpc/cell/axon_msi: Fix refcount leak in setup_msi_msg_address Date: Tue, 23 Aug 2022 10:25:00 +0200 Message-Id: <20220823080058.655478858@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080053.202747790@linuxfoundation.org> References: <20220823080053.202747790@linuxfoundation.org> User-Agent: quilt/0.67 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: Miaoqian Lin [ Upstream commit df5d4b616ee76abc97e5bd348e22659c2b095b1c ] of_get_next_parent() returns a node pointer with refcount incremented, we should use of_node_put() on it when not need anymore. Add missing of_node_put() in the error path to avoid refcount leak. Fixes: ce21b3c9648a ("[CELL] add support for MSI on Axon-based Cell systems") Signed-off-by: Miaoqian Lin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220605065129.63906-1-linmq006@gmail.com Signed-off-by: Sasha Levin --- arch/powerpc/platforms/cell/axon_msi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/platforms/cell/axon_msi.c b/arch/powerpc/platforms/cell/axon_msi.c index 6ea3f248b155..e98b61c06a81 100644 --- a/arch/powerpc/platforms/cell/axon_msi.c +++ b/arch/powerpc/platforms/cell/axon_msi.c @@ -230,6 +230,7 @@ static int setup_msi_msg_address(struct pci_dev *dev, struct msi_msg *msg) if (!prop) { dev_dbg(&dev->dev, "axon_msi: no msi-address-(32|64) properties found\n"); + of_node_put(dn); return -ENOENT; } -- 2.35.1