diff --git a/[refs] b/[refs] index 7fd20106d133..0d740eb1dd3e 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 456ef1553cb2b06729d64c1d1f0f2bda34e9b201 +refs/heads/master: 5a26db5bd25cf4bf32ae9fa9f6136b6b6d5b45c5 diff --git a/trunk/fs/sysfs/dir.c b/trunk/fs/sysfs/dir.c index f281cc6584b0..337162935d21 100644 --- a/trunk/fs/sysfs/dir.c +++ b/trunk/fs/sysfs/dir.c @@ -678,10 +678,8 @@ static struct dentry * sysfs_lookup(struct inode *dir, struct dentry *dentry, sd = sysfs_find_dirent(parent_sd, dentry->d_name.name); /* no such entry */ - if (!sd) { - ret = ERR_PTR(-ENOENT); + if (!sd) goto out_unlock; - } /* attach dentry and inode */ inode = sysfs_get_inode(sd); @@ -783,7 +781,6 @@ int sysfs_rename_dir(struct kobject * kobj, const char *new_name) old_dentry = sysfs_get_dentry(sd); if (IS_ERR(old_dentry)) { error = PTR_ERR(old_dentry); - old_dentry = NULL; goto out; } @@ -851,7 +848,6 @@ int sysfs_move_dir(struct kobject *kobj, struct kobject *new_parent_kobj) old_dentry = sysfs_get_dentry(sd); if (IS_ERR(old_dentry)) { error = PTR_ERR(old_dentry); - old_dentry = NULL; goto out; } old_parent = old_dentry->d_parent; @@ -859,7 +855,6 @@ int sysfs_move_dir(struct kobject *kobj, struct kobject *new_parent_kobj) new_parent = sysfs_get_dentry(new_parent_sd); if (IS_ERR(new_parent)) { error = PTR_ERR(new_parent); - new_parent = NULL; goto out; } @@ -883,6 +878,7 @@ int sysfs_move_dir(struct kobject *kobj, struct kobject *new_parent_kobj) error = 0; d_add(new_dentry, NULL); d_move(old_dentry, new_dentry); + dput(new_dentry); /* Remove from old parent's list and insert into new parent's list. */ sysfs_unlink_sibling(sd); diff --git a/trunk/kernel/lockdep.c b/trunk/kernel/lockdep.c index 723bd9f92556..4335f12a27c6 100644 --- a/trunk/kernel/lockdep.c +++ b/trunk/kernel/lockdep.c @@ -2943,9 +2943,10 @@ void lockdep_free_key_range(void *start, unsigned long size) struct list_head *head; unsigned long flags; int i; + int locked; raw_local_irq_save(flags); - graph_lock(); + locked = graph_lock(); /* * Unhash all classes that were created by this module: @@ -2959,7 +2960,8 @@ void lockdep_free_key_range(void *start, unsigned long size) zap_class(class); } - graph_unlock(); + if (locked) + graph_unlock(); raw_local_irq_restore(flags); } @@ -2969,6 +2971,7 @@ void lockdep_reset_lock(struct lockdep_map *lock) struct list_head *head; unsigned long flags; int i, j; + int locked; raw_local_irq_save(flags); @@ -2987,7 +2990,7 @@ void lockdep_reset_lock(struct lockdep_map *lock) * Debug check: in the end all mapped classes should * be gone. */ - graph_lock(); + locked = graph_lock(); for (i = 0; i < CLASSHASH_SIZE; i++) { head = classhash_table + i; if (list_empty(head)) @@ -3000,7 +3003,8 @@ void lockdep_reset_lock(struct lockdep_map *lock) } } } - graph_unlock(); + if (locked) + graph_unlock(); out_restore: raw_local_irq_restore(flags);