From: Greg Kroah-Hartman Date: Mon, 25 Aug 2025 07:37:04 +0000 (+0200) Subject: fix up queue-5.4/usb-musb-omap2430-fix-device-leak-at-unbind.patch X-Git-Tag: v5.4.297~14 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1501b419878d0df5ea76c04094af05b77fc24977;p=thirdparty%2Fkernel%2Fstable-queue.git fix up queue-5.4/usb-musb-omap2430-fix-device-leak-at-unbind.patch --- diff --git a/queue-5.4/series b/queue-5.4/series index 23d586ce6b..9be5c19f29 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -355,7 +355,6 @@ usb-typec-fusb302-cache-pd-rx-state.patch nfsv4-fix-nfs4_bitmap_copy_adjust.patch nfs-fix-up-handling-of-outstanding-layoutcommit-in-nfs_update_inode.patch nfs-fix-the-setting-of-capabilities-when-automounting-a-new-filesystem.patch -usb-musb-omap2430-convert-to-platform-remove-callback-returning-void.patch usb-musb-omap2430-fix-device-leak-at-unbind.patch rtc-ds1307-handle-oscillator-stop-flag-osf-for-ds1341.patch soc-qcom-mdt_loader-ensure-we-don-t-read-past-the-elf-header.patch diff --git a/queue-5.4/usb-musb-omap2430-convert-to-platform-remove-callback-returning-void.patch b/queue-5.4/usb-musb-omap2430-convert-to-platform-remove-callback-returning-void.patch deleted file mode 100644 index b6432cefbf..0000000000 --- a/queue-5.4/usb-musb-omap2430-convert-to-platform-remove-callback-returning-void.patch +++ /dev/null @@ -1,60 +0,0 @@ -From sashal@kernel.org Thu Aug 21 18:20:28 2025 -From: Sasha Levin -Date: Thu, 21 Aug 2025 12:20:24 -0400 -Subject: usb: musb: omap2430: Convert to platform remove callback returning void -To: stable@vger.kernel.org -Cc: "Uwe Kleine-König" , "Greg Kroah-Hartman" , "Sasha Levin" -Message-ID: <20250821162025.780036-1-sashal@kernel.org> - -From: Uwe Kleine-König - -[ Upstream commit cb020bf52253327fe382e10bcae02a4f1da33c04 ] - -The .remove() callback for a platform driver returns an int which makes -many driver authors wrongly assume it's possible to do error handling by -returning an error code. However the value returned is (mostly) ignored -and this typically results in resource leaks. To improve here there is a -quest to make the remove callback return void. In the first step of this -quest all drivers are converted to .remove_new() which already returns -void. - -Trivially convert this driver from always returning zero in the remove -callback to the void returning variant. - -Signed-off-by: Uwe Kleine-König -Link: https://lore.kernel.org/r/20230405141009.3400693-8-u.kleine-koenig@pengutronix.de -Signed-off-by: Greg Kroah-Hartman -Stable-dep-of: 1473e9e7679b ("usb: musb: omap2430: fix device leak at unbind") -Signed-off-by: Sasha Levin -Signed-off-by: Greg Kroah-Hartman ---- - drivers/usb/musb/omap2430.c | 6 ++---- - 1 file changed, 2 insertions(+), 4 deletions(-) - ---- a/drivers/usb/musb/omap2430.c -+++ b/drivers/usb/musb/omap2430.c -@@ -505,14 +505,12 @@ err0: - return ret; - } - --static int omap2430_remove(struct platform_device *pdev) -+static void omap2430_remove(struct platform_device *pdev) - { - struct omap2430_glue *glue = platform_get_drvdata(pdev); - - platform_device_unregister(glue->musb); - pm_runtime_disable(glue->dev); -- -- return 0; - } - - #ifdef CONFIG_PM -@@ -579,7 +577,7 @@ MODULE_DEVICE_TABLE(of, omap2430_id_tabl - - static struct platform_driver omap2430_driver = { - .probe = omap2430_probe, -- .remove = omap2430_remove, -+ .remove_new = omap2430_remove, - .driver = { - .name = "musb-omap2430", - .pm = DEV_PM_OPS, diff --git a/queue-5.4/usb-musb-omap2430-fix-device-leak-at-unbind.patch b/queue-5.4/usb-musb-omap2430-fix-device-leak-at-unbind.patch index 7e24271444..1d943b656a 100644 --- a/queue-5.4/usb-musb-omap2430-fix-device-leak-at-unbind.patch +++ b/queue-5.4/usb-musb-omap2430-fix-device-leak-at-unbind.patch @@ -1,10 +1,10 @@ -From sashal@kernel.org Thu Aug 21 18:20:28 2025 +From sashal@kernel.org Thu Aug 21 18:14:17 2025 From: Sasha Levin -Date: Thu, 21 Aug 2025 12:20:25 -0400 +Date: Thu, 21 Aug 2025 12:14:13 -0400 Subject: usb: musb: omap2430: fix device leak at unbind To: stable@vger.kernel.org Cc: Johan Hovold , Roger Quadros , Greg Kroah-Hartman , Sasha Levin -Message-ID: <20250821162025.780036-2-sashal@kernel.org> +Message-ID: <20250821161413.775044-2-sashal@kernel.org> From: Johan Hovold @@ -55,12 +55,12 @@ Signed-off-by: Greg Kroah-Hartman err2: platform_device_put(musb); -@@ -511,6 +513,8 @@ static void omap2430_remove(struct platf +@@ -511,6 +513,8 @@ static int omap2430_remove(struct platfo platform_device_unregister(glue->musb); pm_runtime_disable(glue->dev); + if (!IS_ERR(glue->control_otghs)) + put_device(glue->control_otghs); - } - #ifdef CONFIG_PM + return 0; + }