Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp739239rdb; Fri, 17 Nov 2023 11:10:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IHToaAP1/5mjfq2IZ0djD6nRkEzz8QtGDJLrlYxuLyY+R57NyrsoJ7q/PYrcJwUYjRiD9K3 X-Received: by 2002:a05:6a00:6ca2:b0:6ca:2b55:58b7 with SMTP id jc34-20020a056a006ca200b006ca2b5558b7mr434613pfb.20.1700248222988; Fri, 17 Nov 2023 11:10:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700248222; cv=none; d=google.com; s=arc-20160816; b=vjnoCmUiCxYSkrH7GwJba+R24zcmFTX+B6LHUXmkwn/XTNv551PHtP8awKvF5kKijI lrmSqHUh+RdNserZieTCHywcZiAFJhOTL4QUK09YJRCAgQFfFx7mdMJz4GXLttgwL/wX irFCIFDXb016A/rNxWvOAzHraI6ucGHwSxK6uqU0d9+oCLW3QDrZGSzapJkEbEYukRQ1 zN2Y2sjh/PAcqQ3QO70sxuID8V1xv/JT+n9btYBeGEjdq36UlCHPf+MaFFVFIwzZuPD2 WhtLur7owb/1M0M0pU+4PUa7nm/n2rAKUQXZNkVnc8D7Vqe4zoxWdTSEEqmfAEYEiDPr czAQ== 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=hpxsXLMOh5JybuE462HK7tCO92oncuL8g+hgD8Ou5d8=; fh=mmitGHoKZO9lE3IMlVtM5wiEdaNuj6xtLc141AyBvtA=; b=OLAe5pbdrZIO9V5QJk9Fiuu8dZIHB2cucm4FTOVXVPXtZGCJg6b81I7EHpAcLQObYV AIYyDu7dVOkr+NoJX5fvijo7x0u2iTqqEp87PHy4I6nyEBX0qG03dJD7+RuBKny3+eL2 CeGt2nnPKx39PiHgcAdqjMs73W4XZ9hcjVSFHqB0m7JMHimn9vHqTQmY63LgZI9Bmcw6 QlpcO8Mqe0JvjwLCyR9G61ElEq70NLIOQlehTPsf8Le998NDToXTp6mdBZ7DYJPdZ6Pz ivoRiOlkV5VRpdArjSZgY96lXy9TV27aFS4qP2jUGgEHQArggO6LzFk8E3Xn/KJYBuh3 gVmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=DtRo4upe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id f9-20020a631f09000000b005b881cc9498si2497688pgf.339.2023.11.17.11.10.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 11:10:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=DtRo4upe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 29266834A75E; Fri, 17 Nov 2023 11:10:20 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229535AbjKQTJ5 (ORCPT + 99 others); Fri, 17 Nov 2023 14:09:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53158 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230186AbjKQTJ4 (ORCPT ); Fri, 17 Nov 2023 14:09:56 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C701AA4 for ; Fri, 17 Nov 2023 11:09:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700248192; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=hpxsXLMOh5JybuE462HK7tCO92oncuL8g+hgD8Ou5d8=; b=DtRo4upey3e21f36LrrZ2lD9D17Ul/H+fN7+gjyW1lrcdQgKr6hPhY7JE65VD5iHKoHZYi EwNsSdRbW6wl4RR5HhEs3dnDTgyZJ3/qyYKJ9epjfWp2ch7PSApNQ7QOyzhbaTapzRqwrp jsTwPew1EjxdbhnoZ1uWN26LwqzjXbI= Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-466-5SyOtcG5PnGYuIG9Jnombw-1; Fri, 17 Nov 2023 14:09:50 -0500 X-MC-Unique: 5SyOtcG5PnGYuIG9Jnombw-1 Received: by mail-qt1-f197.google.com with SMTP id d75a77b69052e-41cdffe4d1cso25033221cf.0 for ; Fri, 17 Nov 2023 11:09:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700248190; x=1700852990; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=hpxsXLMOh5JybuE462HK7tCO92oncuL8g+hgD8Ou5d8=; b=VNcs/GvVOWpLv0t9VGkzvEUNls2rpdvVn1mt7BC9uf9hEydWn/30Dw/2hXhSArz/WO OuYrnuNUHLSdJbaXzaWTyD7wpBLARpCi8XZ8XJ0l0t2XMEHduONaULlZvJ1QOWEkGUcA oBSB32qLyw7DqTx6f1ojnMvLxWFOCwKC9iqUoyiMNyCsXWun3q/pro3uamzZRwtAAbgs ZBwpFbGiWpbrg3m8svRbs5dNa5JZhkvDV8n1VtPUwt/ayJywXOd0cz84JzwLn3XqjlId t5YOIlHyy0CLhjmgJBQb+lq5v2QP6nX8zSiK6Qi7YdlMMlTGhVh3XcvVdto8Nu0mxgy6 74gw== X-Gm-Message-State: AOJu0YwF8goTxNqfrciH+9HPJKmBQXT4XlRtxUl+00YiF1VC5kqodyv3 6DHzwnezkj28LjEOvnZvAy1SKoBnGnHtKWEa9f/nie1f6vDxGiakcnQS0gzcsXzgFKL6Ty4eH9E fpnXwkeJS7tcGiAC/Ir2HgDYo X-Received: by 2002:ac8:5c09:0:b0:403:eb5b:1f6 with SMTP id i9-20020ac85c09000000b00403eb5b01f6mr624101qti.63.1700248190186; Fri, 17 Nov 2023 11:09:50 -0800 (PST) X-Received: by 2002:ac8:5c09:0:b0:403:eb5b:1f6 with SMTP id i9-20020ac85c09000000b00403eb5b01f6mr624087qti.63.1700248189946; Fri, 17 Nov 2023 11:09:49 -0800 (PST) Received: from fedora ([2600:1700:1ff0:d0e0::49]) by smtp.gmail.com with ESMTPSA id x8-20020ac87a88000000b00419cb97418bsm776100qtr.15.2023.11.17.11.09.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 11:09:49 -0800 (PST) Date: Fri, 17 Nov 2023 13:09:47 -0600 From: Andrew Halaney 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, Heikki Krogerus 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.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 fry.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 (fry.vger.email [0.0.0.0]); Fri, 17 Nov 2023 11:10:20 -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: Andrew Halaney > --- > 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 > >