projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ef49ec1
)
driver core: platform: use put_device() if device_register fail
author
Arvind Yadav
<arvind.yadav.cs@gmail.com>
Sun, 11 Mar 2018 05:55:49 +0000
(11:25 +0530)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Thu, 15 Mar 2018 13:37:04 +0000
(14:37 +0100)
if device_register() returned an error! Always use put_device()
to give up the reference initialized.
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/platform.c
patch
|
blob
|
history
diff --git
a/drivers/base/platform.c
b/drivers/base/platform.c
index f1bf7b38d91ca7ac69a5477ed08103f59e151bbe..8075ddc70a17825f4aa39cc52e3ef82d48f31263 100644
(file)
--- a/
drivers/base/platform.c
+++ b/
drivers/base/platform.c
@@
-1153,8
+1153,10
@@
int __init platform_bus_init(void)
early_platform_cleanup();
error = device_register(&platform_bus);
- if (error)
+ if (error) {
+ put_device(&platform_bus);
return error;
+ }
error = bus_register(&platform_bus_type);
if (error)
device_unregister(&platform_bus);