Patch State
Viewing Patch 9207/1
Not logged in Login...
Please note: this is not a patch review system;
please submit all patches to the linux-arm-kernel mailing
list for community review prior to submission here.

NOTE: The patch system is currently running with workarounds due to a silly change made by MariaDB developers resulting in one of the library's APIs that reports the version number reporting a much smaller number. Links:

Debian BTS #1032074.
Code in Perl's MySQL DBD: mysql_get_client_version() user.
MariaDB discussion: Revert inappropriate libmariadb stable ABI version changes.

Update 31 December 2023: Debian have not resolved this in Bookworm, despite it apparently being resolved in upstream packages. Consequently, the workaround remains in place - which is the normal behaviour that I've come to expect from Linux distros. Bugs and regressions just don't get fixed, and yet again, it has been proven that it is utterly pointless reporting bugs to distros.

Go to patch:
Search summaries:
Add new patch Download this patch Help
Updated - Please read
(November 02, 2019)
ID Version From Date Status
9207/1 5.19-rc1 Wang Kefeng 24 May 2022 09:03:46 UTC Applied
Summary:  amba: fix refcount underflow if amba_device_add() fails
Notes:  - - - Note 1 submitted by Wang Kefeng on 24 May 2022 09:03:46 (UTC) - - -
"ARM: 9192/1: amba: fix memory leak in amba_device_try_add()" leads
to a refcount underflow if amba_device_add() fails, which called by
of_amba_device_create(), the of_amba_device_create() already exists
the error handling, so amba_put_device() only need to be added into
amba_deferred_retry().

Fixes: 7719a68b2fa4 ("ARM: 9192/1: amba: fix memory leak in amba_device_try_add()")
Reported-by: Guenter Roeck <(address hidden)>
Tested-by: Guenter Roeck <(address hidden)>
Signed-off-by: Kefeng Wang <(address hidden)>
- - - Note 2 submitted by Russell King on 26 May 2022 09:55:23 (UTC) - - -
Moved to applied

Applied to git-curr (misc branch).
diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c
index 0e3ed5eb367b..0cb20324da16 100644
--- a/drivers/amba/bus.c
+++ b/drivers/amba/bus.c
@@ -493,13 +493,8 @@ static int amba_device_try_add(struct amba_device *dev, struct resource *parent)
 		goto skip_probe;
 
 	ret = amba_read_periphid(dev);
-	if (ret) {
-		if (ret != -EPROBE_DEFER) {
-			amba_device_put(dev);
-			goto err_out;
-		}
+	if (ret)
 		goto err_release;
-	}
 
 skip_probe:
 	ret = device_add(&dev->dev);
@@ -546,6 +541,7 @@ static int amba_deferred_retry(void)
 			continue;
 
 		list_del_init(&ddev->node);
+		amba_device_put(ddev->dev);
 		kfree(ddev);
 	}