Skip to content

Commit

Permalink
kobject: kobject_put cleanup
Browse files Browse the repository at this point in the history
This patch removes redundant argument checks for kobject_put().

Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Mariusz Kozlowski authored and Greg Kroah-Hartman committed Feb 7, 2007
1 parent f750653 commit b067db4
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/kobject.c
Original file line number Diff line number Diff line change
@@ -195,8 +195,7 @@ int kobject_add(struct kobject * kobj)
if (error) {
/* unlink does the kobject_put() for us */
unlink(kobj);
if (parent)
kobject_put(parent);
kobject_put(parent);

/* be noisy on error issues */
if (error == -EEXIST)
@@ -420,8 +419,7 @@ void kobject_cleanup(struct kobject * kobj)
t->release(kobj);
if (s)
kset_put(s);
if (parent)
kobject_put(parent);
kobject_put(parent);
}

static void kobject_release(struct kref *kref)

0 comments on commit b067db4

Please sign in to comment.