Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2909247iog; Mon, 27 Jun 2022 05:33:58 -0700 (PDT) X-Google-Smtp-Source: AGRyM1seUmHbxb9k3Dxq1AHTmcurLtHoyRwgdxu9bzAEnSfOsv+fQ47uWN48MmpSvLWxdOQtpkUM X-Received: by 2002:a17:90a:1049:b0:1ec:a10e:4071 with SMTP id y9-20020a17090a104900b001eca10e4071mr15689539pjd.227.1656333238332; Mon, 27 Jun 2022 05:33:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656333238; cv=none; d=google.com; s=arc-20160816; b=PMeDlLK6Ph+b1FmSzjJOEzFLO9rv/rIPtfdHS776OmtjfxgeBTmrub0JItwaleSvmV IleAX//OiOAB44yN8LyXMUCXMSuv+V3pPnSnBFeBmJRtpsg3obWVgE5MVSJLbih/J6ye dkMbmI0fdvWMa6RvJworzfjXYF/qQAHGzLRrQwE+5Be8x+7lXV791Uo5vphF0w9z2qbi bboUQnDFCv/cwCefGFbBwZztAO99GQn7dr6+kpLy76FGrAgyGjsoztX18MwqD/Lk1Q/f 4jXViXqCB9Ikye37zcBhXmGDOTdspafpQCofIQPV8cD963Z+RYXNBlRiMA+XYRoADTmK GAOA== 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=Ol+LtCttnNlVaIXnax7lthL5RZ/XBLB1SKjIyFL8CyQ=; b=GcJU3oSQW2j6sDVgqcRvtu8Jh4maYgSo56G5QGVzBVQ7oK1yCHz81fQXRaXelVl8o3 Du62P2554p6PDZGZ52DZVXdW3YdM6RO4Zx05u962DqZwjdYNgj++waBAUkG0GarrJLne TbwMThQS4kevx7HPBTpn5dcYKI4io39b3oBFbIQdsTtB3wvWEkt9b6zC1ghkjPz/KDo+ vY/n0BlXCNe8AgxPTsQtHycXEDmsu6NjK1okQRKxoMRr6bt5OTSrd7VoevGzndBXFMOi 01xDq6osNY9+EyVVKeYJCDdJPlwrW6w/0i7yl3CUniOd7+6HRg4cWPyUe+YY+lBKsmP6 d6Bw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Nxrw6CsK; 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 b21-20020a170902d31500b0016a28448c46si13277582plc.561.2022.06.27.05.33.45; Mon, 27 Jun 2022 05:33:58 -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=Nxrw6CsK; 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 S235142AbiF0L23 (ORCPT + 99 others); Mon, 27 Jun 2022 07:28:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235219AbiF0L1Y (ORCPT ); Mon, 27 Jun 2022 07:27:24 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 774D59585; Mon, 27 Jun 2022 04:27:04 -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 15050614C8; Mon, 27 Jun 2022 11:27:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 21A84C3411D; Mon, 27 Jun 2022 11:27:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329223; bh=OOi6JiC4hHGgym1taXsN4xlgN6UDOKMGxg2GFNAwFLA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Nxrw6CsK40Yn8mXyFdv3Bf4rU1tlT53r5JGW/R3nkyo6IgtGGaV/ulohMa/zK90sw lOJjoAavZSZO4cOCFU5Ni/igCYdUCxGBvGMySTdG6sK6xB7vNlGWZ861fBVpms7hhX tRQG7qsQ/nForlQIJk06WDkBdS971UHwQdFJw1RE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Stable@vger.kernel.org, Jonathan Cameron Subject: [PATCH 5.10 084/102] iio: adc: adi-axi-adc: Fix refcount leak in adi_axi_adc_attach_client Date: Mon, 27 Jun 2022 13:21:35 +0200 Message-Id: <20220627111935.958757066@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111933.455024953@linuxfoundation.org> References: <20220627111933.455024953@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=-7.5 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 commit ada7b0c0dedafd7d059115adf49e48acba3153a8 upstream. of_parse_phandle() returns a node pointer with refcount incremented, we should use of_node_put() on it when not need anymore. Add missing of_node_put() to avoid refcount leak. Fixes: ef04070692a2 ("iio: adc: adi-axi-adc: add support for AXI ADC IP core") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220524074517.45268-1-linmq006@gmail.com Cc: Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman --- drivers/iio/adc/adi-axi-adc.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/iio/adc/adi-axi-adc.c +++ b/drivers/iio/adc/adi-axi-adc.c @@ -334,16 +334,19 @@ static struct adi_axi_adc_client *adi_ax if (!try_module_get(cl->dev->driver->owner)) { mutex_unlock(®istered_clients_lock); + of_node_put(cln); return ERR_PTR(-ENODEV); } get_device(cl->dev); cl->info = info; mutex_unlock(®istered_clients_lock); + of_node_put(cln); return cl; } mutex_unlock(®istered_clients_lock); + of_node_put(cln); return ERR_PTR(-EPROBE_DEFER); }