aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mm/kmemleak.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/mm/kmemleak.c b/mm/kmemleak.c
index c37e8e50e4de..e094c4dbdf55 100644
--- a/mm/kmemleak.c
+++ b/mm/kmemleak.c
@@ -1030,6 +1030,12 @@ static void kmemleak_scan(void)
1030 WARN_ON(!list_empty(&gray_list)); 1030 WARN_ON(!list_empty(&gray_list));
1031 1031
1032 /* 1032 /*
1033 * If scanning was stopped do not report any new unreferenced objects.
1034 */
1035 if (scan_should_stop())
1036 return;
1037
1038 /*
1033 * Scanning result reporting. 1039 * Scanning result reporting.
1034 */ 1040 */
1035 rcu_read_lock(); 1041 rcu_read_lock();
@@ -1184,11 +1190,10 @@ static int kmemleak_seq_show(struct seq_file *seq, void *v)
1184 unsigned long flags; 1190 unsigned long flags;
1185 1191
1186 spin_lock_irqsave(&object->lock, flags); 1192 spin_lock_irqsave(&object->lock, flags);
1187 if (!unreferenced_object(object)) 1193 if ((object->flags & OBJECT_REPORTED) && unreferenced_object(object)) {
1188 goto out; 1194 print_unreferenced(seq, object);
1189 print_unreferenced(seq, object); 1195 reported_leaks++;
1190 reported_leaks++; 1196 }
1191out:
1192 spin_unlock_irqrestore(&object->lock, flags); 1197 spin_unlock_irqrestore(&object->lock, flags);
1193 return 0; 1198 return 0;
1194} 1199}