From: David Herrmann Date: Thu, 8 Jan 2015 23:12:42 +0000 (+0100) Subject: connection: silence lockdep on wrongly _nested() calls X-Git-Tag: upstream/0.20150129.081441utc~63 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0ba566b192bab105d880515840408b9534339f6e;p=platform%2Fcore%2Fsystem%2Fkdbus-bus.git connection: silence lockdep on wrongly _nested() calls If we call lock2() with a==NULL, we call _nested(1), which is wrong. Fix this so lockdep works correctly. Signed-off-by: David Herrmann --- diff --git a/connection.h b/connection.h index 5b5a27a..11dbd31 100644 --- a/connection.h +++ b/connection.h @@ -221,13 +221,21 @@ static inline void kdbus_conn_lock2(struct kdbus_conn *a, struct kdbus_conn *b) if (a < b) { if (a) mutex_lock(&a->lock); - if (b) - mutex_lock_nested(&b->lock, 1); + if (b) { + if (a) + mutex_lock_nested(&b->lock, 1); + else + mutex_lock(&b->lock); + } } else { if (b) mutex_lock(&b->lock); - if (a) - mutex_lock_nested(&a->lock, 1); + if (a) { + if (b) + mutex_lock_nested(&a->lock, 1); + else + mutex_lock(&a->lock); + } } }