Lock chains are only tracked with CONFIG_PROVE_LOCKING=y. Do not report
the memory required for the lock chain array if CONFIG_PROVE_LOCKING=n.

Fixes: ca58abcb4a6d ("lockdep: sanitise CONFIG_PROVE_LOCKING") # v2.6.23
Cc: Peter Zijlstra <[email protected]>
Cc: Waiman Long <[email protected]>
Cc: Johannes Berg <[email protected]>
Signed-off-by: Bart Van Assche <[email protected]>
---
 kernel/locking/lockdep.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
index 5c837a537273..6b89fc39fcf0 100644
--- a/kernel/locking/lockdep.c
+++ b/kernel/locking/lockdep.c
@@ -4282,9 +4282,9 @@ void __init lockdep_init(void)
                (sizeof(struct lock_class) * MAX_LOCKDEP_KEYS +
                sizeof(struct list_head) * CLASSHASH_SIZE +
                sizeof(struct lock_list) * MAX_LOCKDEP_ENTRIES +
-               sizeof(struct lock_chain) * MAX_LOCKDEP_CHAINS +
                sizeof(struct list_head) * CHAINHASH_SIZE
 #ifdef CONFIG_PROVE_LOCKING
+               + sizeof(struct lock_chain) * MAX_LOCKDEP_CHAINS
                + sizeof(struct circular_queue)
 #endif
                ) / 1024
-- 
2.20.0.rc2.403.gdbc3b29805-goog

Reply via email to