Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp417854rdf; Tue, 21 Nov 2023 06:21:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IF337Rw4WutsZzjbQOetss/CXKuWAurFWyKtW1ubDY/eVt5/3R45T/TLSeGH2gxdw2WH0Iq X-Received: by 2002:a17:90b:3b89:b0:285:34c4:a0c8 with SMTP id pc9-20020a17090b3b8900b0028534c4a0c8mr3930777pjb.39.1700576470846; Tue, 21 Nov 2023 06:21:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700576470; cv=none; d=google.com; s=arc-20160816; b=ZPrLhEZHWG0mzzPoGOvznbUQ1sDMqrDd0AcwbSC7TQ20hL+WkZhm+SQZPR4lc5XBrJ RTtUHcCAKVUgdRu7NBXjHvAY68Pys7/na21NxDd/us9YdHI4c7KZEhw0VamCumOZB16b bWYucaPvaVXv2Bqrfx1TANv0XUu/zZTjLKlyUf8UpUordTAKE3Oov4I/sG1EgnWORvg7 N9wOM5XsXWpQK182/ee+yWL6+TlLWSlfiVvoncF8Ci93FPak5vmxd/RmeIxfm1yWj2ku xvPhx/l9kskLoqRi2m6/pLnc7EUGFTD9B10+o4CqI0hvVWvbSd7Ivfg/BbQyZK/PfkAn 2Sow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=juI/bCn2MSfkLVH+6Ex1I3i2GbIjH7/O3/+5H+Yd688=; fh=lB3fkFyJuNtBDzBcZMx7zocEUkIPQ/wl0lit25WbZY8=; b=c3B7L/aWhnLRp9K8D/vGzVSOcaA7dxqhfC8kUFRXq+klmL4B3jr3UlUg5swL4yPRIy GJ3f9IULhC7y4l8NUVs9HXTW4Lc1sxjM8Njal1I25iIFGxS0xSjaz87wu0mEvFAb3T7d 173s/Tw1Aq9VuRFnyJJdJCJeVp080kkGYoNLS187uHe0nLP7M84a+yw0aZh0Q6IiOYLi F3Z0++x1KtyO6+pnPj4J6/nUVaGKqcz4QKUe78ROMN8HXFXdqcqcyy2MInRt8aCuXV5s T2CH/bqKrWPy31YHLuGFUmSjFhHwkgr6D81kBdPXfDrUPLFoi7HwgJ8FVU+J9ZQRWPp7 k7VQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=kkQgLeMV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id ij27-20020a170902ab5b00b001c9fb3b55f0si9737226plb.652.2023.11.21.06.21.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 06:21:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=kkQgLeMV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 69A108087384; Tue, 21 Nov 2023 06:20:28 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234105AbjKUOUM (ORCPT + 99 others); Tue, 21 Nov 2023 09:20:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233912AbjKUOUL (ORCPT ); Tue, 21 Nov 2023 09:20:11 -0500 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A01A9D7E; Tue, 21 Nov 2023 06:20:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1700576406; x=1732112406; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=N0wFReOzgNDh2Uw8c3ueRDTaTSNzFrAmGUI7D1PGMVM=; b=kkQgLeMVL7RTSonUefRoFXrx9FUnD3NYCWnOfH3lEAWr7xeMpKt/X8oS L0NGI7Vo31zC7yhaF4dkS4AeWOMQzPn11BunuTRDAH7Ei9Iqbql6Fil9V y0k91fV38Sb/0WDUh6bQGc/TQ8UlWlaLAMvm7lEWNV06nX49UTBuLk8fU Ux4HdDP2RDtadtJgYOgCdM+P1vEVK9FezWeOLxp4RC/bGALUSU1KW5U21 9vqkE8j7DscKjVXvWdM8Gcc3mqA9pSGhz+0YjVBT4KjdaP25gEcwuGhH9 qckU/paRKcBu4E61axGT1GsS9Q3Hi79eU/irjZ5Ns9aWaG2/A8BTm2AeP w==; X-IronPort-AV: E=McAfee;i="6600,9927,10901"; a="372022143" X-IronPort-AV: E=Sophos;i="6.04,215,1695711600"; d="scan'208";a="372022143" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Nov 2023 06:20:06 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10901"; a="760114797" X-IronPort-AV: E=Sophos;i="6.04,215,1695711600"; d="scan'208";a="760114797" Received: from kuha.fi.intel.com ([10.237.72.185]) by orsmga007.jf.intel.com with SMTP; 21 Nov 2023 06:20:01 -0800 Received: by kuha.fi.intel.com (sSMTP sendmail emulation); Tue, 21 Nov 2023 16:20:00 +0200 Date: Tue, 21 Nov 2023 16:20:00 +0200 From: Heikki Krogerus To: Johan Hovold Cc: Greg Kroah-Hartman , Andy Gross , Bjorn Andersson , Konrad Dybcio , Thinh Nguyen , Krishna Kurapati PSSNV , linux-arm-msm@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH 2/3] USB: dwc3: qcom: fix software node leak on probe errors Message-ID: References: <20231117173650.21161-1-johan+linaro@kernel.org> <20231117173650.21161-3-johan+linaro@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231117173650.21161-3-johan+linaro@kernel.org> X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Tue, 21 Nov 2023 06:20:28 -0800 (PST) On Fri, Nov 17, 2023 at 06:36:49PM +0100, Johan Hovold wrote: > Make sure to remove the software node also on (ACPI) probe errors to > avoid leaking the underlying resources. > > Note that the software node is only used for ACPI probe so the driver > unbind tear down is updated to match probe. > > Fixes: 8dc6e6dd1bee ("usb: dwc3: qcom: Constify the software node") > Cc: stable@vger.kernel.org # 5.12 > Cc: Heikki Krogerus > Signed-off-by: Johan Hovold Acked-by: Heikki Krogerus > --- > drivers/usb/dwc3/dwc3-qcom.c | 13 ++++++++----- > 1 file changed, 8 insertions(+), 5 deletions(-) > > diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c > index 00c3021b43ce..0703f9b85cda 100644 > --- a/drivers/usb/dwc3/dwc3-qcom.c > +++ b/drivers/usb/dwc3/dwc3-qcom.c > @@ -932,10 +932,12 @@ static int dwc3_qcom_probe(struct platform_device *pdev) > interconnect_exit: > dwc3_qcom_interconnect_exit(qcom); > depopulate: > - if (np) > + if (np) { > of_platform_depopulate(&pdev->dev); > - else > + } else { > + device_remove_software_node(&qcom->dwc3->dev); > platform_device_del(qcom->dwc3); > + } > platform_device_put(qcom->dwc3); > clk_disable: > for (i = qcom->num_clocks - 1; i >= 0; i--) { > @@ -955,11 +957,12 @@ static void dwc3_qcom_remove(struct platform_device *pdev) > struct device *dev = &pdev->dev; > int i; > > - device_remove_software_node(&qcom->dwc3->dev); > - if (np) > + if (np) { > of_platform_depopulate(&pdev->dev); > - else > + } else { > + device_remove_software_node(&qcom->dwc3->dev); > platform_device_del(qcom->dwc3); > + } > platform_device_put(qcom->dwc3); > > for (i = qcom->num_clocks - 1; i >= 0; i--) { > -- > 2.41.0 -- heikki