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: 13765654 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0BF9AC531DC for ; Fri, 16 Aug 2024 07:57:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=tU3SngOTRZWMK6BN/xX+yu9LBZ/E3yGuMgZAtpkguzo=; b=r7SqKqkqFvobjXMMc7W+fqKWwm enoZC2dw2sROdmBdCUc2F81JhxUYaBJJen/1DapvBausiA9n+r3ywRyhTqAmNQaz7Xz7PS9VDUSfH r1jE7j6wrpt6NT/g61aWvZtrQDWmxzoQUAS2d5SuZPPo6P3/6+eC0xfSFapR2togOK0fldQSuVMSa mdDLzmd+YTMbkjocHOSodQCP4q6Y4HUQ1TugmyiV8z416yMmZEWgeSv1id+uQ0RAAwhqfB0YWO0uy TPkj7mdqzAYJixFNqOuU8Wa5shJFBTUYhml67HHObX5EbYXB9guGtnbsIlyhGDLY8CzP74hDKTAxk FQofFv7A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1serpG-0000000CC4k-2Fex; Fri, 16 Aug 2024 07:56:46 +0000 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sermp-0000000CBPs-3gyE for linux-arm-kernel@lists.infradead.org; Fri, 16 Aug 2024 07:54:17 +0000 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-37182eee02dso819845f8f.1 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=lists.infradead.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=YxbxmBDRsOobcEE5ZgKWvL9rbu3y2v6GINOjQKZpbNoCmUdiFzhHsovhqF3odwKxFK ScV7YE421TWYMnC0h4+TUWYaB0F6XjPXWFqwfHyNwzCd9LgrAJhlzLpsnqkH560Xu8aY qH4r5xsGc4Rmca9pmHe3JJccRqSmAizA7NdiC9YqkwYkyZjLnbzMHEmvflYmluSW8mtr R0KpF9vodEk9XhBSm+mPfDzGH56SllOQ/rluE9xXBDPzrAxzDcvMRcyo499fPsEn5Yhc sWwCFY8lq8poeOEb/gLCEdFmjXQaqziH/+zCpOCws+q7xeADjh1aHEe+E63bkWm95T1q RtBw== 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=R4+SnWfcGrji/C6muIEYhVJsRT8cIp1UpfTQ/xN5f4oDAdhRD5ozYDtFSS0kh1mJRx l3WE0t0PNTWlzj/a17b6etgfHF4FjsrtLO2txs4Sn1SRF0cNyocyykOOkuh9hnwC1uIi SRDU2/9MpWVsexvG2o1f85GRh15hF2bFM36xktJmleJa7C7nBw9IonyuzgzVWTPF5Do2 rlmLsqTv/9tZT3eR8w+FRRCSTRteLVXxd2sXkNabSojBsd8E/qqrVQyMDrvOBGGC3pNf V8WKta1tT7L/aOF496wvtI+O1v/4hG3aOwXeUfKDXz8vRoxr+XKHAVMr42EVGO6rbKsX E06A== X-Forwarded-Encrypted: i=1; AJvYcCVBB1eLzPlAoX/3wgzpOkXRpTluNFTfS5xSzAAmkO691Wl9hJ+YI+E0kSE+ngoLyATZGwAqYZmLVEoXvc7OBA3s@lists.infradead.org X-Gm-Message-State: AOJu0YwRkoM0G3IFr28O7dzDHtdhpc+jL3u1HdT5ISRNym9iw52UD5c8 43UapZdnV2YUFPzE7FPN3m5Eqjyf0NSHzH6Q9LA8k47hRpe9YHIbz9YnI1tQfqw= 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 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240816_005415_957217_FAB37778 X-CRM114-Status: GOOD ( 12.34 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 --- 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: 13765655 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 38B0FC3DA4A for ; Fri, 16 Aug 2024 07:57:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=R3rfqVHruVOGC2FYVz0rFlsxOciO54KGc2d/kghQsw0=; b=oouqW4/qOFY8LmpYflOsg0UMoI VbSHhTqpsUUtclJICb18WpfO+KUBQnMHXRhzRrnPk9C0KrgSZTrtUmAoROpB4RLREx+BJn+szk5LE GSlusZtrcIi43zuKNoFzJQJJHR8dk79gEBY4rDPfnec/xn0axzhdI6vhYrRNQ+X4qSIrxEvM8G5g7 UvmMmZyOIdk3oc+FflBK+Kbstg6kUXLg7QwnaTSxZbmHC7yt0FO2vDcZ2Nl4Xw0BE2WFYOqfT2eAW TUHBV0WBMr2BC68ad4lWMIUWtvl+MiMQZ4HwF7Dalyx/ikXB003gaES/DHlZr79tpgRhUcSrcbcYS X882qnAw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1serpr-0000000CCAv-0vpi; Fri, 16 Aug 2024 07:57:23 +0000 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sermr-0000000CBQV-01aw for linux-arm-kernel@lists.infradead.org; Fri, 16 Aug 2024 07:54:18 +0000 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-369f68f63b1so987814f8f.2 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=lists.infradead.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=hcLXPCn1LeLE2yMtQlMJ2QAMZg6Rpxg3bKXFXEAdHA9XKePebBYRIlExZdIFJqRCpO 2sZElKNdAQOozhQvGk60V0JinfJCfyfYgw4y5Umvtca94goC2KLlZCrHxo8Y0hU1JAji O1+1If82TIr/fH/PBpE5s4NdnlSCW07CB4y+oax5jbiFvjsq9f/5Mt2PWakhGOKsIAcn w6ElY72caiwYpxajO2a+pdUfTzoJXSK6K86SrIwXLWR9lZI2LIBdFFoDW7AxztZRx1/u q4PhPTvbkBH0qVOpFI62KM3EAiJ/ePrJS6eyeH/4WH4LwhslWT8XeNzokQyobONwf428 00Uw== 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=dSvHA6t1ZpWD9fW9kvZVY0WUx3T/8Cq9yZDSvn2LJ2VicN3hE6ExF3+PFLinK8tron rL7/Cspfho98WsYSCHYgGVNhZE0ONza+hW7mZz4a7By7K4Nai3fVPgP1YU+jbUdJN79q DaIpKc65+9g/1SKXXzx2PHYehe6Kxp8y1VYkwXf7T7TaHKMU53Gh6jfVT/LOg093lE7r 7EX6467Pqc0UJggVsz2NMjx694dspxL4KvfQjSEBBBme5FtFJcNHwEeLbd9sJazMaf5d pxig4qExBAV/SmtUU4LCxlFB1IZ0P2Dl2bQTO/Nh2T2uLdE0Iq2Xz2ddPczQsbzvDvJL sYog== X-Forwarded-Encrypted: i=1; AJvYcCX4RyZ5qJ65ZtwTqX2YGUMnfWcug26YMzX56R/9HRgpzyMK7lwZNr8ayrYPo/gjwO5UXMMqnBye5EiIXTugdVGYaoic8GuFN0g9F+C/nZ3PJqSrpvI= X-Gm-Message-State: AOJu0Yw7UwZ4eGLgOfrj82OtyaPk+hjca3D3+VTUiNbKo6jxuOGysplk er5UXya6diTErVQ76FkgSMOPs/7U3lGDJVS4pXo8InK10iHwnH/eLTO3pKct1Ww= 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> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240816_005417_093717_E89377FE X-CRM114-Status: GOOD ( 13.12 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 Acked-by: Thinh Nguyen --- 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: