From: Namhyung Kim Date: Fri, 11 Feb 2011 06:07:01 +0000 (+0100) Subject: kernel/user.c: add lock release annotation on free_user() X-Git-Tag: v2.6.35.12~164 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cec5d24f1ce6c52f5d2ed93b845e0de40127c88c;p=thirdparty%2Fkernel%2Fstable.git kernel/user.c: add lock release annotation on free_user() commit 571428be550fbe37160596995e96ad398873fcbd upstream. free_user() releases uidhash_lock but was missing annotation. Add it. This removes following sparse warnings: include/linux/spinlock.h:339:9: warning: context imbalance in 'free_user' - unexpected unlock kernel/user.c:120:6: warning: context imbalance in 'free_uid' - wrong count at exit Signed-off-by: Namhyung Kim Signed-off-by: Andi Kleen Cc: Ingo Molnar Cc: Dhaval Giani Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Mike Galbraith Signed-off-by: Greg Kroah-Hartman --- diff --git a/kernel/user.c b/kernel/user.c index 8ce395f74d47d..5c598ca781df4 100644 --- a/kernel/user.c +++ b/kernel/user.c @@ -91,6 +91,7 @@ static struct user_struct *uid_hash_find(uid_t uid, struct hlist_head *hashent) * upon function exit. */ static void free_user(struct user_struct *up, unsigned long flags) + __releases(&uidhash_lock) { uid_hash_remove(up); spin_unlock_irqrestore(&uidhash_lock, flags);