aboutsummaryrefslogtreecommitdiffstats
path: root/mm/kmemleak.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/kmemleak.c')
-rw-r--r--mm/kmemleak.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/mm/kmemleak.c b/mm/kmemleak.c
index 5aabd41ffb8f..487267310a84 100644
--- a/mm/kmemleak.c
+++ b/mm/kmemleak.c
@@ -1217,7 +1217,6 @@ static void *kmemleak_seq_start(struct seq_file *seq, loff_t *pos)
1217 } 1217 }
1218 object = NULL; 1218 object = NULL;
1219out: 1219out:
1220 rcu_read_unlock();
1221 return object; 1220 return object;
1222} 1221}
1223 1222
@@ -1233,13 +1232,11 @@ static void *kmemleak_seq_next(struct seq_file *seq, void *v, loff_t *pos)
1233 1232
1234 ++(*pos); 1233 ++(*pos);
1235 1234
1236 rcu_read_lock();
1237 list_for_each_continue_rcu(n, &object_list) { 1235 list_for_each_continue_rcu(n, &object_list) {
1238 next_obj = list_entry(n, struct kmemleak_object, object_list); 1236 next_obj = list_entry(n, struct kmemleak_object, object_list);
1239 if (get_object(next_obj)) 1237 if (get_object(next_obj))
1240 break; 1238 break;
1241 } 1239 }
1242 rcu_read_unlock();
1243 1240
1244 put_object(prev_obj); 1241 put_object(prev_obj);
1245 return next_obj; 1242 return next_obj;
@@ -1255,6 +1252,7 @@ static void kmemleak_seq_stop(struct seq_file *seq, void *v)
1255 * kmemleak_seq_start may return ERR_PTR if the scan_mutex 1252 * kmemleak_seq_start may return ERR_PTR if the scan_mutex
1256 * waiting was interrupted, so only release it if !IS_ERR. 1253 * waiting was interrupted, so only release it if !IS_ERR.
1257 */ 1254 */
1255 rcu_read_unlock();
1258 mutex_unlock(&scan_mutex); 1256 mutex_unlock(&scan_mutex);
1259 if (v) 1257 if (v)
1260 put_object(v); 1258 put_object(v);