git.openpandora.org
/
pandora-kernel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
powerpc/pci/rpadlpar: Fix device reference leaks
[pandora-kernel.git]
/
drivers
/
pci
/
hotplug
/
rpadlpar_core.c
diff --git
a/drivers/pci/hotplug/rpadlpar_core.c
b/drivers/pci/hotplug/rpadlpar_core.c
index
1d002b1
..
9de3f7c
100644
(file)
--- a/
drivers/pci/hotplug/rpadlpar_core.c
+++ b/
drivers/pci/hotplug/rpadlpar_core.c
@@
-18,6
+18,7
@@
#undef DEBUG
#include <linux/init.h>
#undef DEBUG
#include <linux/init.h>
+#include <linux/module.h>
#include <linux/pci.h>
#include <linux/string.h>
#include <linux/vmalloc.h>
#include <linux/pci.h>
#include <linux/string.h>
#include <linux/vmalloc.h>
@@
-258,8
+259,13
@@
static int dlpar_add_phb(char *drc_name, struct device_node *dn)
static int dlpar_add_vio_slot(char *drc_name, struct device_node *dn)
{
static int dlpar_add_vio_slot(char *drc_name, struct device_node *dn)
{
- if (vio_find_node(dn))
+ struct vio_dev *vio_dev;
+
+ vio_dev = vio_find_node(dn);
+ if (vio_dev) {
+ put_device(&vio_dev->dev);
return -EINVAL;
return -EINVAL;
+ }
if (!vio_register_device_node(dn)) {
printk(KERN_ERR
if (!vio_register_device_node(dn)) {
printk(KERN_ERR
@@
-335,6
+341,9
@@
static int dlpar_remove_vio_slot(char *drc_name, struct device_node *dn)
return -EINVAL;
vio_unregister_device(vio_dev);
return -EINVAL;
vio_unregister_device(vio_dev);
+
+ put_device(&vio_dev->dev);
+
return 0;
}
return 0;
}