aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/hfi1/debugfs.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2016-09-01 12:33:46 -0400
committerThomas Gleixner <tglx@linutronix.de>2016-09-01 12:33:46 -0400
commit0cb7bf61b1e9f05027de58c80f9b46a714d24e35 (patch)
tree41fb55cf62d07b425122f9a8b96412c0d8eb99c5 /drivers/infiniband/hw/hfi1/debugfs.c
parentaa877175e7a9982233ed8f10cb4bfddd78d82741 (diff)
parent3eab887a55424fc2c27553b7bfe32330df83f7b8 (diff)
Merge branch 'linus' into smp/hotplug
Apply upstream changes to avoid conflicts with pending patches.
Diffstat (limited to 'drivers/infiniband/hw/hfi1/debugfs.c')
-rw-r--r--drivers/infiniband/hw/hfi1/debugfs.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/infiniband/hw/hfi1/debugfs.c b/drivers/infiniband/hw/hfi1/debugfs.c
index dbab9d9cc288..a49cc88f08a2 100644
--- a/drivers/infiniband/hw/hfi1/debugfs.c
+++ b/drivers/infiniband/hw/hfi1/debugfs.c
@@ -223,28 +223,32 @@ DEBUGFS_SEQ_FILE_OPEN(ctx_stats)
223DEBUGFS_FILE_OPS(ctx_stats); 223DEBUGFS_FILE_OPS(ctx_stats);
224 224
225static void *_qp_stats_seq_start(struct seq_file *s, loff_t *pos) 225static void *_qp_stats_seq_start(struct seq_file *s, loff_t *pos)
226__acquires(RCU) 226 __acquires(RCU)
227{ 227{
228 struct qp_iter *iter; 228 struct qp_iter *iter;
229 loff_t n = *pos; 229 loff_t n = *pos;
230 230
231 rcu_read_lock();
232 iter = qp_iter_init(s->private); 231 iter = qp_iter_init(s->private);
232
233 /* stop calls rcu_read_unlock */
234 rcu_read_lock();
235
233 if (!iter) 236 if (!iter)
234 return NULL; 237 return NULL;
235 238
236 while (n--) { 239 do {
237 if (qp_iter_next(iter)) { 240 if (qp_iter_next(iter)) {
238 kfree(iter); 241 kfree(iter);
239 return NULL; 242 return NULL;
240 } 243 }
241 } 244 } while (n--);
242 245
243 return iter; 246 return iter;
244} 247}
245 248
246static void *_qp_stats_seq_next(struct seq_file *s, void *iter_ptr, 249static void *_qp_stats_seq_next(struct seq_file *s, void *iter_ptr,
247 loff_t *pos) 250 loff_t *pos)
251 __must_hold(RCU)
248{ 252{
249 struct qp_iter *iter = iter_ptr; 253 struct qp_iter *iter = iter_ptr;
250 254
@@ -259,7 +263,7 @@ static void *_qp_stats_seq_next(struct seq_file *s, void *iter_ptr,
259} 263}
260 264
261static void _qp_stats_seq_stop(struct seq_file *s, void *iter_ptr) 265static void _qp_stats_seq_stop(struct seq_file *s, void *iter_ptr)
262__releases(RCU) 266 __releases(RCU)
263{ 267{
264 rcu_read_unlock(); 268 rcu_read_unlock();
265} 269}