Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp444676iog; Mon, 13 Jun 2022 06:07:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwWkOyKzdYi3gGCWF+q+3FpuJf9mIW+pFFQqDqegaoANlFAtCZylmHVuSjhaEgMj4CbHRD4 X-Received: by 2002:aa7:ce84:0:b0:42d:ce51:8c6e with SMTP id y4-20020aa7ce84000000b0042dce518c6emr67178659edv.10.1655125661856; Mon, 13 Jun 2022 06:07:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655125661; cv=none; d=google.com; s=arc-20160816; b=TxLFREpBZ/RSTsH+lM4vYrKHIQ6WROKhLS6AE+q1yTJ7uRS7FtW1terDjrYDwqOC0P 37z5aToSZ7CFtkOH+IVhhAngCuh278FlP+AIkqh9f+ptU9sbctHWodPD+lr0AAgEADYJ rTip+nVG9B3YOqiYvaEkmPXSWNnxhzaYW54hqdv0eN2xvxlqcXTqlF54l94qQ5KnLBa+ IalUMHkFeqLnffnUoJ88/a8L/vGtbiM5D8p1qi5fgDgDDZ15XYyKN7a3gItMQVhOWF5/ C1l/occt95B5XNVmTAddU1tefw2Xf0x2IcJ1w/f9I2Ue6iOQnR6qLOIlwOAvOJYAYdEO J2Sw== 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=tOF/VXsOrFj3am3mzXK7gHq2c6l4rZcqIbaUi3PifJofpfO0goDuMzCOcpdVHxzZq/ Ed3dqnHFxcgJtTkmhXuDDl/z71fUu5y3jyWx4nS/+oGw18hNlye1GS6w1gvX5RCQH/bg jFPEVEsG3dKCx5Il8hd/bGShHj8FdxB0GBVhE1/W9RLMOJjYf7O5Kw76SbaLNh6IJXGt Pb0C+5z9cp7MQR6GrFgL6sQWoGZuKg2rTGvKwkrygoedF+kwiJVyXMuxlQw7y71O/ygT e0fcdWVvH5xVC/lyn3hDQGp3oSRwzOtSN/EyBgFoL+WDIz+fVbP/yKD8W5fTfwZkBSmU Zo+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=o4UDRVtJ; 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 o16-20020a50fd90000000b0042dc8984831si5773555edt.359.2022.06.13.06.07.15; Mon, 13 Jun 2022 06:07:41 -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=o4UDRVtJ; 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 S243059AbiFMKWB (ORCPT + 99 others); Mon, 13 Jun 2022 06:22:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45532 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242747AbiFMKUg (ORCPT ); Mon, 13 Jun 2022 06:20:36 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5EE482125B; Mon, 13 Jun 2022 03:17:09 -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 sin.source.kernel.org (Postfix) with ESMTPS id C793ACE1166; Mon, 13 Jun 2022 10:17:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D1483C34114; Mon, 13 Jun 2022 10:17:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655115426; bh=tx6HgN386WLwB2WB8TgNOq4Nshf8cgFom7qnPkHSvdU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=o4UDRVtJi5ZHNvL8Wtco4mNSmfR6Wrxsh/CDgoYOph2syT+WneVIET9PGbByCxZNB WCxWFtBoFfe3BlcpnMR7pIBGtAlxwoTyoWzuh2HNyDuv/zEYIuzM5zfEdyBNliokex fnwDICq/YR24LMuW3/5KMcN3pVLKnQZVn6fVaUsA= 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.9 072/167] Input: sparcspkr - fix refcount leak in bbc_beep_probe Date: Mon, 13 Jun 2022 12:09:06 +0200 Message-Id: <20220613094857.756908010@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220613094840.720778945@linuxfoundation.org> References: <20220613094840.720778945@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