Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 75845
b: refs/heads/master
c: 09f82ea
h: refs/heads/master
i:
  75843: 712e588
v: v3
  • Loading branch information
Alan Stern authored and Greg Kroah-Hartman committed Jan 25, 2008
1 parent 2226750 commit d868b37
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 97c146ef075dc40ae34407c03d3860fc3850b8e8
refs/heads/master: 09f82ea92822a7bbb7e816508abbda47ed54a77f
7 changes: 4 additions & 3 deletions trunk/lib/kobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,16 @@ void kobject_init(struct kobject * kobj)

static void unlink(struct kobject * kobj)
{
struct kobject *parent = kobj->parent;

if (kobj->kset) {
spin_lock(&kobj->kset->list_lock);
list_del_init(&kobj->entry);
spin_unlock(&kobj->kset->list_lock);
}
kobj->parent = NULL;
kobject_put(kobj);
kobject_put(parent);
}

/**
Expand Down Expand Up @@ -208,7 +212,6 @@ int kobject_add(struct kobject * kobj)
if (error) {
/* unlink does the kobject_put() for us */
unlink(kobj);
kobject_put(parent);

/* be noisy on error issues */
if (error == -EEXIST)
Expand Down Expand Up @@ -590,7 +593,6 @@ static void kobject_cleanup(struct kobject *kobj)
{
struct kobj_type * t = get_ktype(kobj);
struct kset * s = kobj->kset;
struct kobject * parent = kobj->parent;
const char *name = kobj->k_name;

pr_debug("kobject: '%s' (%p): %s\n",
Expand All @@ -604,7 +606,6 @@ static void kobject_cleanup(struct kobject *kobj)
}
if (s)
kset_put(s);
kobject_put(parent);
}

static void kobject_release(struct kref *kref)
Expand Down

0 comments on commit d868b37

Please sign in to comment.