lkml.org 
[lkml]   [2024]   [Feb]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] ARM: sa1111: fix put_device() before device_add() in error path
Date
When request_resource() fails, a jump is made to err_resource label which
calls put_device() on &dev->res without adding it first.
Kept the err_resource label and moved put_device() to err_add label.

Signed-off-by: Alfredo Cruz <alfredo.carlon@gmail.com>
---
arch/arm/common/sa1111.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/common/sa1111.c b/arch/arm/common/sa1111.c
index 1fbd7363cf11..76bf15da5115 100644
--- a/arch/arm/common/sa1111.c
+++ b/arch/arm/common/sa1111.c
@@ -779,8 +779,8 @@ sa1111_init_one_child(struct sa1111 *sachip, struct resource *parent,

err_add:
release_resource(&dev->res);
- err_resource:
put_device(&dev->dev);
+ err_resource:
err_alloc:
return ret;
}
--
2.43.2

\
 
 \ /
  Last update: 2024-05-27 15:15    [W:0.045 / U:0.460 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site