Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp6137843iog; Thu, 23 Jun 2022 12:08:09 -0700 (PDT) X-Google-Smtp-Source: AGRyM1s2C4uWCra96VR8Sj6HIB6svPsr18cJCrTkDkB4bgl5McX/hc+yCjfEX1sUChjnaHUl1yuD X-Received: by 2002:a05:6402:3587:b0:435:b9a1:d5c5 with SMTP id y7-20020a056402358700b00435b9a1d5c5mr10672333edc.219.1656011288971; Thu, 23 Jun 2022 12:08:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656011288; cv=none; d=google.com; s=arc-20160816; b=fxgFthpRkEkV0Fwd2TonbS09ycWvlAWCHOr+VhIFfvzoCv5t0nBW7Vmbh1sbYGTTIF 2DGDOQvFajzbbtGdC3wsVRnB7zSAXk9CNu64XQj67tcHxrzM06sF8hXjinGP6v1IQz6U Srkv7bdLRt3HSc/FST+yiXEblw9JCU58nMinDnqr5PvUrnrf7tRCeDSFtCfdxWRStPDL FB1JCO+lGAHUe7d73BhTmW7reAtkXRxDaDZFKzJhPl17BKYWA/06aQUuuCZwGafq/hdO MXLS3kpeHzxsSNsDavuNLTtaQGRW0eF09Cr4XcR6kELWTtoVGwNtq/U1boh2N5iMbzED N9PA== 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=RaERpuMbJnFX5As8tRXjfjxix+kdUdKZavzh314r8Jw=; b=TgmSgZsaJ4CUeBhyDnbS2sYl4oie21Nb0T8P7YG/msmr9QIJPkxJi/u39r8NpFXdaQ 25QKMG/YtS8tjezfYFTMsfyJcY1+VwQiIOL5i+qQHUON/YXekys0IDogoS0LSgig6eS5 H4kaJdPX9iiN76FTKwIH1N795WNKpNRQm6XnZDALEd37W1JQVO5t0YHDtm2HF4ig2V/e u3GCKwmBy34ZGzTAC0dWeexiSlBACQw/7YMC7m1iAJ7B7Mh/HuLYAW46/mx77M5jP7Ey NZu40D6lKM/vBE+32j5ZcPgwD0K0AbxZSRwcpSYDViXw+MX3EwpyysUx9gajmCA6Mp1/ tZvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=aYKQINNr; 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 ss2-20020a170907c00200b0070d8de4e431si19419814ejc.206.2022.06.23.12.07.43; Thu, 23 Jun 2022 12:08:08 -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=aYKQINNr; 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 S231691AbiFWRO2 (ORCPT + 99 others); Thu, 23 Jun 2022 13:14:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229723AbiFWRMP (ORCPT ); Thu, 23 Jun 2022 13:12:15 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 959E82DCC; Thu, 23 Jun 2022 09:57:47 -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 007F060B2C; Thu, 23 Jun 2022 16:57:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BC61EC3411B; Thu, 23 Jun 2022 16:57:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656003461; bh=YFSLUmsgfLwiMcvlShyqk9K23fj8lUXfyVTV4G0bNOM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aYKQINNrKG5+/eaf5Yd+g6un6okTUIEH623GaFWnjvmWDWXrsKKJtl8z7++3mjT87 Kk+KffML947xCenfOGkUw8nPhxAy83++EFm0MPqJAZfzdtBmNXtutuIOr24t2pJEWz JTz+wFv1K9HhroxsFH4JxgYKUWrt0dNO77nQ1ooA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, stable , Miaoqian Lin Subject: [PATCH 4.9 245/264] usb: gadget: lpc32xx_udc: Fix refcount leak in lpc32xx_udc_probe Date: Thu, 23 Jun 2022 18:43:58 +0200 Message-Id: <20220623164351.003771829@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220623164344.053938039@linuxfoundation.org> References: <20220623164344.053938039@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.7 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 4757c9ade34178b351580133771f510b5ffcf9c8 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. of_node_put() will check NULL pointer. Fixes: 24a28e428351 ("USB: gadget driver for LPC32xx") Cc: stable Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220603140246.64529-1-linmq006@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/usb/gadget/udc/lpc32xx_udc.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/usb/gadget/udc/lpc32xx_udc.c +++ b/drivers/usb/gadget/udc/lpc32xx_udc.c @@ -3034,6 +3034,7 @@ static int lpc32xx_udc_probe(struct plat } udc->isp1301_i2c_client = isp1301_get_client(isp1301_node); + of_node_put(isp1301_node); if (!udc->isp1301_i2c_client) { retval = -EPROBE_DEFER; goto phy_fail;