projects
/
platform
/
kernel
/
linux-rpi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8de6028
)
slimbus: core: use put_device() instead of kfree()
author
Arvind Yadav
<arvind.yadav.cs@gmail.com>
Fri, 9 Mar 2018 14:09:59 +0000
(14:09 +0000)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Thu, 15 Mar 2018 16:55:52 +0000
(17:55 +0100)
Never directly free @dev after calling device_register(), even
if it 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: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/slimbus/core.c
patch
|
blob
|
history
diff --git
a/drivers/slimbus/core.c
b/drivers/slimbus/core.c
index 4988a8f4d90552a51501791ee3abe2737f428305..7ddfc675b131fba29bb9419541d58169cba5aa22 100644
(file)
--- a/
drivers/slimbus/core.c
+++ b/
drivers/slimbus/core.c
@@
-141,7
+141,7
@@
static struct slim_device *slim_alloc_device(struct slim_controller *ctrl,
sbdev->e_addr = *eaddr;
ret = slim_add_device(ctrl, sbdev, node);
if (ret) {
-
kfree(sb
dev);
+
put_device(&sbdev->
dev);
return NULL;
}