From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5067B2F4A19 for ; Thu, 21 Aug 2025 12:44:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755780253; cv=none; b=QzUevYg8y07cu/KtlfjD5nT4pTFXwgBbabyQH94SjHbYe0u7uUyn7fMITH9cHI0BipwFISNMjt+Fv0kIY9ODIFZzD1edOWOIqwEqOTdIfRJR7lUPkfjC+wNwOHq/PsMAxhVTNQXFFPM6l2RzyNJ8OrlgoJvt2yY5S5vN9Ih2Wyk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755780253; c=relaxed/simple; bh=lSL5Wq3D1LLPvfZ27uAjjVQojDzFDuUsMYCvj9rBDH0=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=p8Yzp0/i0mJ4wUUFjhY6Gkw+FuPaQ1TvKWkcW/FPJ7XCIkORQIhCjWiTxJLHI7vrhnNc99oHVC2L+ol5BLMwwGS7tay+WlFSukqaTrl9dBe7L1emXKIwYoxSQe6xksbPGxgv9IErGj1i6bOYt2OoX7TvJ4XcH7qLkgOyH94adfk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=RrC5W4WU; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="RrC5W4WU" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6A547C4CEEB; Thu, 21 Aug 2025 12:44:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1755780252; bh=lSL5Wq3D1LLPvfZ27uAjjVQojDzFDuUsMYCvj9rBDH0=; h=Subject:To:Cc:From:Date:From; b=RrC5W4WUVsPHF2opKcL+qEDSOuhBbGyJ2Q8KwvJ0HJe/v5VTijB6kl0B36JDjMS7i oppBJJb4VwqH1+jgOT7N6FfSeen1wvZp+gH8HctqNoEzbnmngfDDa2oeYNqk/fE5c9 gua4uJxpsFvxIgzNT3wwDTqr9oDDRhYKkUvcVPgQ= Subject: FAILED: patch "[PATCH] usb: musb: omap2430: fix device leak at unbind" failed to apply to 5.10-stable tree To: johan@kernel.org,gregkh@linuxfoundation.org,rogerq@kernel.org Cc: From: Date: Thu, 21 Aug 2025 14:43:55 +0200 Message-ID: <2025082155-easing-flavorful-b21d@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 5.10-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.10.y git checkout FETCH_HEAD git cherry-pick -x 1473e9e7679bd4f5a62d1abccae894fb86de280f # git commit -s git send-email --to '' --in-reply-to '2025082155-easing-flavorful-b21d@gregkh' --subject-prefix 'PATCH 5.10.y' HEAD^.. Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 1473e9e7679bd4f5a62d1abccae894fb86de280f Mon Sep 17 00:00:00 2001 From: Johan Hovold Date: Thu, 24 Jul 2025 11:19:09 +0200 Subject: [PATCH] usb: musb: omap2430: fix device leak at unbind Make sure to drop the reference to the control device taken by of_find_device_by_node() during probe when the driver is unbound. Fixes: 8934d3e4d0e7 ("usb: musb: omap2430: Don't use omap_get_control_dev()") Cc: stable@vger.kernel.org # 3.13 Cc: Roger Quadros Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20250724091910.21092-5-johan@kernel.org Signed-off-by: Greg Kroah-Hartman diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c index 2970967a4fd2..36f756f9b7f6 100644 --- a/drivers/usb/musb/omap2430.c +++ b/drivers/usb/musb/omap2430.c @@ -400,7 +400,7 @@ static int omap2430_probe(struct platform_device *pdev) ret = platform_device_add_resources(musb, pdev->resource, pdev->num_resources); if (ret) { dev_err(&pdev->dev, "failed to add resources\n"); - goto err2; + goto err_put_control_otghs; } if (populate_irqs) { @@ -413,7 +413,7 @@ static int omap2430_probe(struct platform_device *pdev) res = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!res) { ret = -EINVAL; - goto err2; + goto err_put_control_otghs; } musb_res[i].start = res->start; @@ -441,14 +441,14 @@ static int omap2430_probe(struct platform_device *pdev) ret = platform_device_add_resources(musb, musb_res, i); if (ret) { dev_err(&pdev->dev, "failed to add IRQ resources\n"); - goto err2; + goto err_put_control_otghs; } } ret = platform_device_add_data(musb, pdata, sizeof(*pdata)); if (ret) { dev_err(&pdev->dev, "failed to add platform_data\n"); - goto err2; + goto err_put_control_otghs; } pm_runtime_enable(glue->dev); @@ -463,7 +463,9 @@ static int omap2430_probe(struct platform_device *pdev) err3: pm_runtime_disable(glue->dev); - +err_put_control_otghs: + if (!IS_ERR(glue->control_otghs)) + put_device(glue->control_otghs); err2: platform_device_put(musb); @@ -477,6 +479,8 @@ static void omap2430_remove(struct platform_device *pdev) platform_device_unregister(glue->musb); pm_runtime_disable(glue->dev); + if (!IS_ERR(glue->control_otghs)) + put_device(glue->control_otghs); } #ifdef CONFIG_PM