summaryrefslogtreecommitdiff
path: root/drivers/parisc/pdc_stable.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/parisc/pdc_stable.c')
-rw-r--r--drivers/parisc/pdc_stable.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/parisc/pdc_stable.c b/drivers/parisc/pdc_stable.c
index 3651c3871d5b..1b4aacf2ff9a 100644
--- a/drivers/parisc/pdc_stable.c
+++ b/drivers/parisc/pdc_stable.c
@@ -992,8 +992,10 @@ pdcs_register_pathentries(void)
entry->kobj.kset = paths_kset;
err = kobject_init_and_add(&entry->kobj, &ktype_pdcspath, NULL,
"%s", entry->name);
- if (err)
+ if (err) {
+ kobject_put(&entry->kobj);
return err;
+ }
/* kobject is now registered */
write_lock(&entry->rw_lock);