Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2204389iof; Tue, 7 Jun 2022 23:08:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx6iwV62efzdGDpQkDFAxvzJlPBMbUadNQCBx3lWa6yMI+nIi3Sr+Y2Fmfv4t8dfJajB7hu X-Received: by 2002:a17:902:d044:b0:166:4d45:2b0c with SMTP id l4-20020a170902d04400b001664d452b0cmr28129770pll.99.1654668491119; Tue, 07 Jun 2022 23:08:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654668491; cv=none; d=google.com; s=arc-20160816; b=R3WINJW6cUJMiDeDQkGQk4a04Ot8Vr4goc+XuLLSyQ25mbsymqCrl0zDizNRa/SAFL xp2MkKmrN27ah6kafqIzdD7UZDGJzSnMS/6eg3+gYN3e3GjOTktsvxA1LKczgI9g0NNJ JlFNdpmr6Vd1zeSdMdNSwawgatoOvl0EcwjtK8pMO5PdaU9jAYNnS4TgbzZxvlMeYfT5 o4FzUxtw4mh+uH4xWyeKi2q0tiMJ+xuoiZMyKsHfi937261t2qqgKGq5tsyHmptrcsE3 VGk2+l07iWdW/R0SxeAFW8ihS58S0oPJ2bLcPu+mnM4pvLdz6TmSwEd93jVRASe1o1Ra kJ6A== 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=SX8nfRPtegmqhJLWqddGXqETi9m9WpC5vQYeUwspEIs=; b=cb5zxSXWcntUyine0pKMvsc1HimQ4h2993oPLcgAHe5uQMAqwzZeMdLjQI0ppk9NgE Z50dwMTqWFheY8i8MFtylpiQnJEWljFtA+X7yhGsmM5LrlQ+P7yjSvNESeNarkcoFfuh AMnSDfUHhl1exid/oLUfV/wtzFzq+OzOOR1mGJnnno+dIBEn1Gn4DWp5MuqfCYaXGIpC 8dnrbLlIk0IU4akyA/HaPPdEuEr87h765nZpCFJ24xE32w6vYW/U9sFQ0dk2RCf0ZSLb 5qnkRKWrmOnNQzMbTWkfgWv2jHrvkollq1VRrcDzc7J/EeN3bgV5pGaAmLrvvoLfixK6 oL2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=NLugf7DG; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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. [23.128.96.19]) by mx.google.com with ESMTPS id y35-20020a056a00182300b005105cb7e94fsi18632692pfa.271.2022.06.07.23.08.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 23:08:11 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=NLugf7DG; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 34DF7E204E; Tue, 7 Jun 2022 22:31:43 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1386280AbiFHBgl (ORCPT + 99 others); Tue, 7 Jun 2022 21:36:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49782 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1384810AbiFGWUs (ORCPT ); Tue, 7 Jun 2022 18:20:48 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8FF9263286; Tue, 7 Jun 2022 12:20:44 -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 7361060A21; Tue, 7 Jun 2022 19:20:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 81A46C385A2; Tue, 7 Jun 2022 19:20:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654629643; bh=qVgSGNTA10yoXOmVS9eSdEfnCYfxg4a9wPi4RdE+Q6o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NLugf7DGnePok2QMzFSSwdUzIF+2y/G4UhWIJ+cMJUD/de0Ua8EJYrgvgeizkiedy GfTcRGDtVAbVUl3iujvrBTtxMe9o35HE8TXzowhBR9isdHtSduHjjfblO69PubLp8s fXl7K6QIHFBBo0zdcG5NujhraNsOYefEWrtDvw5A= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Corey Minyard Subject: [PATCH 5.18 724/879] ipmi:ipmb: Fix refcount leak in ipmi_ipmb_probe Date: Tue, 7 Jun 2022 19:04:02 +0200 Message-Id: <20220607165023.869056542@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607165002.659942637@linuxfoundation.org> References: <20220607165002.659942637@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=-3.1 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=unavailable 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 commit a508e33956b538e034ed5df619a73ec7c15bda72 upstream. of_parse_phandle() returns a node pointer with refcount incremented, we should use of_node_put() on it when done. Add missing of_node_put() to avoid refcount leak. Fixes: 00d93611f002 ("ipmi:ipmb: Add the ability to have a separate slave and master device") Signed-off-by: Miaoqian Lin Message-Id: <20220512044445.3102-1-linmq006@gmail.com> Cc: stable@vger.kernel.org # v5.17+ Signed-off-by: Corey Minyard Signed-off-by: Greg Kroah-Hartman --- drivers/char/ipmi/ipmi_ipmb.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/char/ipmi/ipmi_ipmb.c +++ b/drivers/char/ipmi/ipmi_ipmb.c @@ -476,6 +476,7 @@ static int ipmi_ipmb_probe(struct i2c_cl slave_np = of_parse_phandle(dev->of_node, "slave-dev", 0); if (slave_np) { slave_adap = of_get_i2c_adapter_by_node(slave_np); + of_node_put(slave_np); if (!slave_adap) { dev_notice(&client->dev, "Could not find slave adapter\n");