Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2929841iog; Mon, 20 Jun 2022 07:42:39 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vZhpelJGVapblrkDYBf3z5i2KmNjF5yOmMiE2zkwtFOyp0Vli/81UIHPDx70hlKOpl5wFk X-Received: by 2002:a63:24c7:0:b0:3fc:5c99:a196 with SMTP id k190-20020a6324c7000000b003fc5c99a196mr21792324pgk.521.1655736158821; Mon, 20 Jun 2022 07:42:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655736158; cv=none; d=google.com; s=arc-20160816; b=dbFlal9KD1YMRQWWCUUvrr9Q+ioYcJYmd1uavakmTNo+RlFZ8Ue/T1DnpEBCkBalAZ +TDU4W0giqIFj7YmXfODmcwMGU56sv6uZu/MqfgA+YOScMPARdFWOLH7hfcYdnASeQp9 LBauzgo03o1xShHclyISh4BGOATgth0tiqLIa7wLSe+uNcfbY55CThh96LWhENmjqhem r0ccuFwUBMYFVajtM+Nss5a8hzFEvNvzqV0UmJ/WhZNxUTiCLnqKtzBmJl+G1D6hrYGJ 4Ck5nkfAzPIYfCF8hC1QBUBFk9JJvVURgcie7c6rWJO8cWA+hb4eLq/jR5bqte96R6wp ugcg== 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=EGMF4GqqgKK4g0u+/vLMSgxRjL5pbtCp1LQwh0C/Uug=; b=ZFysuTlElBx2yhJoFHyAehHFRP/Aw2DAb06XJODi89lWzT2lZS8TG3cJ9M2bapVbmf SLO+2x4/M3ByuD/MXlnmly0ZVXxxP2JcWe5r4GKwlgxF7gXjAbjZJ/606sYM6wjlP5Sj JSoYTy7WfDTb+rST1ayTUqJBCz+Y0b68uOSRWAzr6y5s/d2MVl9cwoOHcn1hZk2tsCK5 CU2c0zo27q7KCqlo8D8fkBnVPfxQwcY0O1hLZquG2uaeYq2QgpVM6Dz3znCh99e1ujf8 oN/8bgE+vxOIe844LoXTm4aXSUYlx8AJghWYcclbM76geyu2id59urzW/CYUNkn1Hb7D gGUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=y9KALw2X; 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 5-20020a630a05000000b003f667dd5faasi16203368pgk.82.2022.06.20.07.42.25; Mon, 20 Jun 2022 07:42:38 -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=y9KALw2X; 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 S1349110AbiFTOIU (ORCPT + 99 others); Mon, 20 Jun 2022 10:08:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352321AbiFTN4S (ORCPT ); Mon, 20 Jun 2022 09:56:18 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0FE81B8D; Mon, 20 Jun 2022 06:22:17 -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 ams.source.kernel.org (Postfix) with ESMTPS id 8DBC3B80E7D; Mon, 20 Jun 2022 13:22:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D1122C3411B; Mon, 20 Jun 2022 13:22:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655731333; bh=7t+s0ziznUjXdQS+S/uk61BpyecWr0vrFpg8O5OBnsc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=y9KALw2XphkRSWScQuf3gCIVkE8seho5/sdP2L+y5ooxNCcMrBmUgdksCkBbdHhlb jLC9BGNKj7KjNcHkXwbsEeBthDMO2mwLYDWPIS1cN/Ji7SHcLBFMWzqj/hranGGN/W qXOlsDZv3dWr9X2v0r2+guP91431jjJ18fcOtyCU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, stable , Miaoqian Lin Subject: [PATCH 5.4 225/240] usb: gadget: lpc32xx_udc: Fix refcount leak in lpc32xx_udc_probe Date: Mon, 20 Jun 2022 14:52:06 +0200 Message-Id: <20220620124745.480702063@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220620124737.799371052@linuxfoundation.org> References: <20220620124737.799371052@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 @@ -3027,6 +3027,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) { return -EPROBE_DEFER; }