Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp448949iog; Mon, 13 Jun 2022 06:11:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw6miltzfJHmuv4XG0MFE1xsU302tNZaYS3aI76MGrWuDQawd+kmDKejFhEeNfe4SFZL0I9 X-Received: by 2002:a17:907:7b8a:b0:707:59d4:14a3 with SMTP id ne10-20020a1709077b8a00b0070759d414a3mr52720506ejc.51.1655125392847; Mon, 13 Jun 2022 06:03:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655125392; cv=none; d=google.com; s=arc-20160816; b=vsKDde7nBE+3v2WuHashEwwkffQ7DhyyqpqT7kYAmIVBCypiVmZyXTcM9SxvlK17Lh /ehEkp8sDy6oX2wRWkspuPQ/hdSUaeTqgmfH2eHh0yIt1L34QtmHFgy2xsKKUP4k2Jgv 5Hf0cZYD13OcRpi61GQQEV2o9ZrGzDA2ge94vyEehNUDl87b35rM+KXkpOJqgJmdTWQE IiX8ivbuUMm4s3/Uy2KmMa5Kx8hGDjhesux8+z0ZNYULjh9s1VzjALA079SelvkyqUX4 PIbIK7Q4+3ZjrOC6158v9GNqgcMrPqqvV6vk6TNNDZbw/rK+NhgisF9V20E0ZGR3nG3/ c4ZA== 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=xpRHzrjOGebrI5Gpe6xJku7G4t1oHl9nCFiCOKTcpvo=; b=nwmrgvjEeXdpCKFEUOKQuJa6jY/uWnu0xDqhAsd5wuojaqGKAvgfBHEKVHMm3LS3DD UgBn8bWULLZMHrYPjoyUpFbNhc2PxWSdV8RnwH1uJcek9ItNd9c7qTMkSRe4vDjfgcmL bYyuOJZfzygsNfi+6sBjk1pdabHCm26eE/Xvx77IGX2ky1jfarGE8AtQ61UWw6Ge6ETQ iHWqd+Nbc7etS6/cXu2VtHEA0n+Kwn4/S4IWRR5LqRbgeUrrf2Qlsw8LWBfFoiJYu/J8 yuH2IVJdbJLqFoum/hQb8jC2fv0Kcsx9mQMfsqUDpGPW0Ue8DoSoBsMDrmW7Kqeq0lAb oegQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=0JCmMsws; 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 cw11-20020a170906478b00b00711efd98320si9258717ejc.241.2022.06.13.06.02.45; Mon, 13 Jun 2022 06:03:12 -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=0JCmMsws; 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 S237237AbiFMKtt (ORCPT + 99 others); Mon, 13 Jun 2022 06:49:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344335AbiFMKrW (ORCPT ); Mon, 13 Jun 2022 06:47:22 -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 5DE8E2C104; Mon, 13 Jun 2022 03:25:58 -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 A4E3160EF5; Mon, 13 Jun 2022 10:25:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AD551C34114; Mon, 13 Jun 2022 10:25:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655115957; bh=tx6HgN386WLwB2WB8TgNOq4Nshf8cgFom7qnPkHSvdU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0JCmMswsHcLnWrUtNU3kqZingkDXSV6a4LtqDJ05Gdi5UAm9KS9K6WCHtQzISUleM LbBSmZ1A/xUhPldvpK/1p0eix5N5pcNpZCUCjPzskLnsRznvcJOS/x+I9RW+AIYbSC c5CydIzJNWtxpme2DSmZ5V9fstNUeZjLuqRxJp0w= 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 4.14 093/218] Input: sparcspkr - fix refcount leak in bbc_beep_probe Date: Mon, 13 Jun 2022 12:09:11 +0200 Message-Id: <20220613094923.364745016@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220613094908.257446132@linuxfoundation.org> References: <20220613094908.257446132@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=-8.3 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 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 4a5afc7fe96e..f6e1f38267d9 100644 --- a/drivers/input/misc/sparcspkr.c +++ b/drivers/input/misc/sparcspkr.c @@ -204,6 +204,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