Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2206253iof; Tue, 7 Jun 2022 23:11:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwgRwEGsRrMoZRbyYATTj+lkLmxQKFyLcVF4DOJon/1534qW0O168YX1QR1rYWsD/xbqLXd X-Received: by 2002:a17:90a:6602:b0:1e3:17e:6290 with SMTP id l2-20020a17090a660200b001e3017e6290mr36516179pjj.37.1654668679383; Tue, 07 Jun 2022 23:11:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654668679; cv=none; d=google.com; s=arc-20160816; b=RiK5798J2JsM3blDSI7OkxPnxoekHy8HG2tKrpa1g2pLAgJ0YPLwK1KD6/FjtnCwov XYDOqZk56VNVCKutoixXkGLAUuE9WkdW/Ru3ilZ4rKS3Xx3FnJF3I9U/eSraBlO8qu51 M6s8WzJUkihXIcD5HDg3ypSVZ7HjFIQrWUDsSutUB8SuDYPlijs7IUsJwQepoqKth9F0 gItEkFAGTA4CCkYFIHcw1PtfTMbypjkBFctA4Bm2z0PvpLc7CzRptPF8QFJk3i+LIkiW CowA+VEWTamQB7Ej/9QQseHP2w83Tj5NLzkBkdIlSNAQwRG49UHMxc0u8fbcvKZM8gm8 xiUw== 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=vgmglT19b6Yu5oJl9RgJpXO1d/C7PR3ZC1YFqnCYVFM=; b=I3GZNHhoYNN6suNuGsghbk2tEwl5bRCaDmg+sX3B18+ehmCMdtfVNkPrYhOc5mWg3H 20dlJIeKiAVnb9NxyI2L/DTW39d1mxqP7FNU4/uiM3/adSLg7o0MzvvJM5u1SQyoYxaA +yIaAR2ZF/8IKCGl3Q3MWmeEEarciPd0OnDbXxrN35j9Dl/FwWk9exRLrIpw95D5lUEJ MPEDZCMOJarSLdGzyaBqyq1Z1P36MTW655jvT3adKcOh5+JbZCerzGEk0ICByIbcsenx GLSjpel+Zj+N1epCm0qoEOLiC5ymmE1YUNZiB6iXPzA2B07/hUDvumPS90IRhH8ievIn 6Ilg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=emSbu9NK; 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 u4-20020a63df04000000b003faefdcaec8si27503388pgg.816.2022.06.07.23.11.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 23:11:19 -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=emSbu9NK; 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7D34B2BB9B4; Tue, 7 Jun 2022 22:33:25 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1385746AbiFHBpK (ORCPT + 99 others); Tue, 7 Jun 2022 21:45:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1382437AbiFGWCi (ORCPT ); Tue, 7 Jun 2022 18:02:38 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB8B924F799; Tue, 7 Jun 2022 12:14: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 dfw.source.kernel.org (Postfix) with ESMTPS id 95180617DA; Tue, 7 Jun 2022 19:14:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A0D59C34115; Tue, 7 Jun 2022 19:14:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654629272; bh=F+Ejk3TJqvM9iJL5X57Am9LXrVwli2Qkgi0+4c09buY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=emSbu9NKAwLEWGI8kU9fBYnhVb5SGKSYdjzBJXxxXKX/qaHfsRCN35JH+ZVALTgnk 3LAO9cO/l66GiplBom+sVCtsMK0TCL2PyBp4flcGiaMCHBTRY2mN/fbCtG1JQzucQT hkZ5qF4LvguxVfC/K4Xy2NIk42F2DFWwBPapn2mA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Dmitry Torokhov , Sasha Levin Subject: [PATCH 5.18 629/879] Input: sparcspkr - fix refcount leak in bbc_beep_probe Date: Tue, 7 Jun 2022 19:02:27 +0200 Message-Id: <20220607165021.107265229@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 [ Upstream commit c8994b30d71d64d5dcc9bc0edbfdf367171aa96f ] of_find_node_by_path() calls of_find_node_opts_by_path(), which 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: 9c1a5077fdca ("input: Rewrite sparcspkr device probing.") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220516081018.42728-1-linmq006@gmail.com Signed-off-by: Dmitry Torokhov Signed-off-by: Sasha Levin --- drivers/input/misc/sparcspkr.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/input/misc/sparcspkr.c b/drivers/input/misc/sparcspkr.c index fe43e5557ed7..cdcb7737c46a 100644 --- a/drivers/input/misc/sparcspkr.c +++ b/drivers/input/misc/sparcspkr.c @@ -205,6 +205,7 @@ static int bbc_beep_probe(struct platform_device *op) info = &state->u.bbc; info->clock_freq = of_getintprop_default(dp, "clock-frequency", 0); + of_node_put(dp); if (!info->clock_freq) goto out_free; -- 2.35.1