From patchwork Fri Aug 16 07:54:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 820020 Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9418D7BB17 for ; Fri, 16 Aug 2024 07:54:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723794857; cv=none; b=D4b05pnclHzoI4La2dVRp9sSPQGpsYupzrvApf8FOQ7TYpGnzYq+8DPatE0CpUhCvcJRUohhLlTChhqqOCk3D9H6r0x/cnqGJ9p+ziHFDbdE1dWCuHv9u5cYfmFAhUwVS4IlZkInGOCsXS0o/sw+TVxFB2Rjqf8UKIZW1lceF3k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723794857; c=relaxed/simple; bh=29i/Me7OBdCQHNsyp4wD7LL65eIiAwGoh7GQQszBp8U=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=edT3t2NXYChnqNw7KIKznefC+J98quLjmP/0+rvgtnw4tfZjOEmb909q0faY57LMX25CcY++TTo4p3P6AchXxYt2bMvZH4rxjGLjiF+JoBDlqQREHguXYNIaVKg71sy1GzXYPen46W66AdxV333md9cUt984c/IDkKvepxEj+P4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=XS8p9N88; arc=none smtp.client-ip=209.85.128.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="XS8p9N88" Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-428f5c0833bso14481985e9.0 for ; Fri, 16 Aug 2024 00:54:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723794854; x=1724399654; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=tU3SngOTRZWMK6BN/xX+yu9LBZ/E3yGuMgZAtpkguzo=; b=XS8p9N88nYpSpafKR5VNkJ0KlCs6bRKE/hBOKuOLVyQjFvNJlgzaWjmswgblf6g9Mn JEiVtG9E3Z2qDEHodkiikVQEsp95q91FY5mynueEeiGKnJPlJrOsUL2Vo8x8mf+KCD5+ 2rpQ/i+kw9f/67tynsFEt9KCP2GVBpRWsFxFO6yh1HfwZXq+FtR+72VPIrTKrO7sKx05 b2wDBnDgKyuLPy/Ry2C9WesGAQD/JLjjOzXVi7iwq4bOITnm6joGDv+iZp2BdQrQ/u1V QsjZPD48A7zz5RPYkPMYmbgbxKS+dgz7HogGOmDQH+IoiMGC132iacY15t5to+VMBK9S 0DIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723794854; x=1724399654; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=tU3SngOTRZWMK6BN/xX+yu9LBZ/E3yGuMgZAtpkguzo=; b=rpkudfcxtjO2yuRubZzFLoPDlJFTot7KuEzuvuSv7/DAt9LmWCdnmvhTSC36bNrS05 lBJC39SNB/MCTGnfNbX5f3DUPKyanMJcaDzdkIMSaS9QSK1ACH9TpZR0MluJgrSFb5FD VueJhr2HKbv4o8cFespYYLbNJCEYXVe4RgueGnPki974LdYZjVUCB/VUdwMRHIc9sczZ x2NmvNG/+LrB+RkYpqdGBf0GDcM+u7ozO7MdrjqJ9uuneu/a+8p3gdBi3pBsG9tIzQpb ZtZq3i0HuJHt0yQ/e05+4nu79tv78nsmFyO0k73HxVfzpXZVvx+eXTdYj4jOOCmVIUUB vmFw== X-Forwarded-Encrypted: i=1; AJvYcCU35m+oJnVzz1QTpCu7Iz5Nc+z1FV8sQo2CBHvxnEHmeCl7eBmv9K99iRduK5tCVxgVizXilSpbQ2o=@vger.kernel.org X-Gm-Message-State: AOJu0YyD9Cb/nE9fhSRyAVY7UhKNqFi5eBP3EPnz1/l1JEnZCxh7r8aR I5Do4fSRwvSLOCL5JXWIErGI5awxJGLfh3LH9M+qrJfRD3AF+lre/UrJLhyxc2M= X-Google-Smtp-Source: AGHT+IEqEG4Bzu7IHX7pi9rFGKS2JnZDvCN4JyxP3fZbBWB8dkTAP9Pd/d8ezaB2qKeYO7fLJBnoqg== X-Received: by 2002:adf:f9ce:0:b0:371:939e:9855 with SMTP id ffacd0b85a97d-37194bf6970mr1133066f8f.21.1723794853685; Fri, 16 Aug 2024 00:54:13 -0700 (PDT) Received: from krzk-bin.. ([178.197.215.209]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37189863109sm3049587f8f.65.2024.08.16.00.54.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Aug 2024 00:54:13 -0700 (PDT) From: Krzysztof Kozlowski To: Thinh Nguyen , Greg Kroah-Hartman , Michal Simek , Vignesh R , Felipe Balbi , Grygorii Strashko , Piyush Mehta , Radhey Shyam Pandey , linux-usb@vger.kernel.org, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Krzysztof Kozlowski , stable@vger.kernel.org Subject: [PATCH v2 1/2] usb: dwc3: omap: add missing depopulate in probe error path Date: Fri, 16 Aug 2024 09:54:08 +0200 Message-ID: <20240816075409.23080-1-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Depopulate device in probe error paths to fix leak of children resources. Fixes: ee249b455494 ("usb: dwc3: omap: remove IRQ_NOAUTOEN used with shared irq") Cc: stable@vger.kernel.org Acked-by: Thinh Nguyen Signed-off-by: Krzysztof Kozlowski Acked-by: Thinh Nguyen --- Changes in v2: 1. Add Ack --- drivers/usb/dwc3/dwc3-omap.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c index d5c77db4daa9..2a11fc0ee84f 100644 --- a/drivers/usb/dwc3/dwc3-omap.c +++ b/drivers/usb/dwc3/dwc3-omap.c @@ -522,11 +522,13 @@ static int dwc3_omap_probe(struct platform_device *pdev) if (ret) { dev_err(dev, "failed to request IRQ #%d --> %d\n", omap->irq, ret); - goto err1; + goto err2; } dwc3_omap_enable_irqs(omap); return 0; +err2: + of_platform_depopulate(dev); err1: pm_runtime_put_sync(dev); pm_runtime_disable(dev); From patchwork Fri Aug 16 07:54:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 821308 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1F2FB84A32 for ; Fri, 16 Aug 2024 07:54:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723794858; cv=none; b=VlRqAdSv7TmzVnUPENGBiX49SLLNxd6rA1XZzkgPZE0V8oRZTPahz5+G4OmC7dNQEsY2gBoiuz2jBJxKVa4LaLElOU6nPO1q003Qb9h6xEoJp0kB8irlgE4QnPrOJPRqiItTR4yKwTe+vECpbgpsbZXVZ7a+uR1yvP/0r2bWKvI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723794858; c=relaxed/simple; bh=fRFrl2xxLajW7BRlASDFQqs8x0H30DLVpH4SEKpcKME=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=krQSMAOJf8OVtppEMU8znr0vmCaqeKhE3z6iOQ/K4VYeg0VF0cdrfWujJIcbuiX5ebcrdUYBRig9j5otDLsarXUwAXZOxHwJ36YrjGNe/V/wX+SIWeQkQb5Mjb8fSR9mTIxoH5Il/HydfRwma3tE5Pxo6suBv4sfO66bi71Ib5E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=mQsA+kPI; arc=none smtp.client-ip=209.85.128.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="mQsA+kPI" Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-42819654737so11420995e9.1 for ; Fri, 16 Aug 2024 00:54:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723794855; x=1724399655; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=R3rfqVHruVOGC2FYVz0rFlsxOciO54KGc2d/kghQsw0=; b=mQsA+kPI13RKBFLvR2K94Sea9cG9BePP8h6T3TdgDXuqxAi100wlm4+ixEsEkpk/cf l/zUU+JSnKgOtn15WiFfNQ6F0u6ZPZx4csdoWnSPAMwVg5UFI9eLpl1L6y49ZuBdV/zp iTMGkXzRhOHMcS2Rx1mwX9zy4TaoCRV4f1Z/UysAkt+fRmPTbrBDznOTCv/Isz5mWpwC cBpyswdLOlakwPJ+aZ/fI6yCb/cA2wMHnFqVm5CDaVwlIeRZFi42m94oWT8Bn+3Ihb0+ JIzHNiUEqiX4U7Xfvo0jsqIDvZSyKV+4Xi3BW2bV2rKI2oL6I7vvi6K2GR5Cm8pL3UXN hkBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723794855; x=1724399655; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=R3rfqVHruVOGC2FYVz0rFlsxOciO54KGc2d/kghQsw0=; b=ZJFA6oyLJCjXXAosYIYXj54ioi7zxuxg0yQWN50RuTM54VsPA/JWk1S2fEdG+1Hq0d pfrxcyv1kzRjI4t4fqlaEKkeezuN67LKZPh7PpshRKszcvAYB3q8adNO9hwLVGgN1tmc wjxZez5OYF6n3ru2Qj19msK77/K8qPRtItwubuHARLBOKflIGh0Aj7mAKZyV4Q2ceWvw 4lODOCykxd5znGC8AlSvkx9z5Q7ga0xibp5+rlADk1zcUaxZra2wJv3gHcPU983KDW+T Xn/lefCJNGkk4B0NgUNoOl0YO2KHWqTu2zhWt3lhcVLta5atF9HuD/2YZ8edRDKq+waX n2fQ== X-Forwarded-Encrypted: i=1; AJvYcCVDE9RXDNdOzeFFDQQl1JyZ/Q0lzs2BGvIBmnu4eWLFKsQICyFaMpAoUupgNZqE1RxlMwsfsVscTfQCnKTJRvtYiYymKfVf6Q0b X-Gm-Message-State: AOJu0YxfGdk11T8hHGm5UIljtNSoEZEj+emI70ls4KRZgEYA6L6EPdb7 gFkFY9aqAnEGJFXc3hVZCy8DI2U/O0r1svTFNvhSj5wAA+gK0IK2XKuxTJUoX7A= X-Google-Smtp-Source: AGHT+IELJsEIdJrzfxRlYTFmph//NPsFzW/KOkCn+6qANqNPjCBjFgoONw7BALUdqn6MkGE37+0afA== X-Received: by 2002:a05:6000:dc4:b0:364:6c08:b9b2 with SMTP id ffacd0b85a97d-371946a3dabmr1036836f8f.45.1723794855161; Fri, 16 Aug 2024 00:54:15 -0700 (PDT) Received: from krzk-bin.. ([178.197.215.209]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37189863109sm3049587f8f.65.2024.08.16.00.54.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Aug 2024 00:54:14 -0700 (PDT) From: Krzysztof Kozlowski To: Thinh Nguyen , Greg Kroah-Hartman , Michal Simek , Vignesh R , Felipe Balbi , Grygorii Strashko , Piyush Mehta , Radhey Shyam Pandey , linux-usb@vger.kernel.org, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Krzysztof Kozlowski , stable@vger.kernel.org Subject: [PATCH v2 2/2] usb: dwc3: xilinx: add missing depopulate in probe error path Date: Fri, 16 Aug 2024 09:54:09 +0200 Message-ID: <20240816075409.23080-2-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240816075409.23080-1-krzysztof.kozlowski@linaro.org> References: <20240816075409.23080-1-krzysztof.kozlowski@linaro.org> Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Depopulate device in probe error paths to fix leak of children resources. Fixes: 53b5ff83d893 ("usb: dwc3: xilinx: improve error handling for PM APIs") Cc: stable@vger.kernel.org Reviewed-by: Radhey Shyam Pandey Signed-off-by: Krzysztof Kozlowski --- Changes in v2: 1. Add goto also on pm_runtime_resume_and_get() failure (Thinh) 2. Add Rb tag. --- drivers/usb/dwc3/dwc3-xilinx.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/usb/dwc3/dwc3-xilinx.c b/drivers/usb/dwc3/dwc3-xilinx.c index bb4d894c16e9..f1298b1b4f84 100644 --- a/drivers/usb/dwc3/dwc3-xilinx.c +++ b/drivers/usb/dwc3/dwc3-xilinx.c @@ -327,9 +327,14 @@ static int dwc3_xlnx_probe(struct platform_device *pdev) goto err_pm_set_suspended; pm_suspend_ignore_children(dev, false); - return pm_runtime_resume_and_get(dev); + ret = pm_runtime_resume_and_get(dev); + if (ret < 0) + goto err_pm_set_suspended; + + return 0; err_pm_set_suspended: + of_platform_depopulate(dev); pm_runtime_set_suspended(dev); err_clk_put: