lkml.org 
[lkml]   [2016]   [Apr]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 04/15] task_diag: add a new interface to get information about tasks (v4)
On Tue, Apr 12, 2016 at 10:08:57AM +0300, Cyrill Gorcunov wrote:
> On Mon, Apr 11, 2016 at 04:35:44PM -0700, Andrey Vagin wrote:
> ...
> > +static int __taskdiag_dumpit(struct task_iter *iter,
> > + struct task_diag_cb *cb, struct task_struct **start)
> > +{
> > + struct user_namespace *userns = current_user_ns();
> > + struct task_struct *task = *start;
> > + int rc;
> > +
> > + for (; task; task = iter_next(iter)) {
> > + if (!ptrace_may_access(task, PTRACE_MODE_READ_FSCREDS))
> > + continue;
> > +
> > + rc = task_diag_fill(task, cb->resp, &iter->req,
> > + cb, iter->ns, userns);
> > + if (rc < 0) {
> > + if (rc != -EMSGSIZE)
> > + return rc;
> > + break;

task isn't NULL here

> > + }
> > + }
> > + *start = task;
>
> task = NULL always here?

No, it isn't if the loop is interrupted by break.

Thanks,
Andrew

\
 
 \ /
  Last update: 2016-04-13 03:01    [W:0.111 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site