Avoid depending on lockdep internals everywhere. Use
kdbus_conn_assert_active() to check whether the caller holds an active
reference.
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
mutex_unlock(&b->lock);
}
+/**
+ * kdbus_conn_assert_active() - lockdep assert on active lock
+ * @conn: connection that shall be active
+ *
+ * This verifies via lockdep that the caller holds an active reference to the
+ * given connection.
+ */
+static inline void kdbus_conn_assert_active(struct kdbus_conn *conn)
+{
+ lockdep_assert_held(conn);
+}
+
#endif
struct kdbus_item *item;
int ret = 0;
- lockdep_assert_held(conn);
+ kdbus_conn_assert_active(conn);
entry = kzalloc(sizeof(*entry), GFP_KERNEL);
if (!entry)
struct kdbus_match_db *mdb = conn->match_db;
int ret;
- lockdep_assert_held(conn);
+ kdbus_conn_assert_active(conn);
down_write(&mdb->mdb_rwlock);
ret = kdbus_match_db_remove_unlocked(mdb, cmd->cookie);