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:
d3c68d0
)
sparc: vio: use put_device() instead of kfree()
author
Arvind Yadav
<arvind.yadav.cs@gmail.com>
Wed, 25 Apr 2018 14:56:14 +0000
(20:26 +0530)
committer
David S. Miller
<davem@davemloft.net>
Mon, 30 Apr 2018 20:09:34 +0000
(16:09 -0400)
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: David S. Miller <davem@davemloft.net>
arch/sparc/kernel/vio.c
patch
|
blob
|
history
diff --git
a/arch/sparc/kernel/vio.c
b/arch/sparc/kernel/vio.c
index 1a0fa10cb6b721747b479651119b095d05893de0..32bae68e34c1b617c2e1547cbea9f609dc285d8f 100644
(file)
--- a/
arch/sparc/kernel/vio.c
+++ b/
arch/sparc/kernel/vio.c
@@
-403,7
+403,7
@@
static struct vio_dev *vio_create_one(struct mdesc_handle *hp, u64 mp,
if (err) {
printk(KERN_ERR "VIO: Could not register device %s, err=%d\n",
dev_name(&vdev->dev), err);
-
kfree(v
dev);
+
put_device(&vdev->
dev);
return NULL;
}
if (vdev->dp)