public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Yong Zhang <yong.zhang0@gmail.com>
To: Wang Xingchao <xingchao.wang@intel.com>
Cc: linux-kernel@vger.kernel.org, mingo@elte.hu,
	peterz@infradead.org, alex.shi@intel.com
Subject: Re: [PATCH] cfs: NULL pointer check
Date: Fri, 16 Sep 2011 13:57:58 +0800	[thread overview]
Message-ID: <20110916055758.GB10741@zhy> (raw)
In-Reply-To: <1316195333-12374-1-git-send-email-xingchao.wang@intel.com>

On Fri, Sep 16, 2011 at 01:48:53PM -0400, Wang Xingchao wrote:
> se maybe NULL if cfs_rq->rb_leftmost is NULL

I don't think se could be NULL here. Because we call check_preempt_tick()
iff 'cfs_rq->nr_running > 1'.

Thanks,
Yong

> 
> Signed-off-by: Wang Xingchao <xingchao.wang@intel.com>
> ---
>  kernel/sched_fair.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
> index fef0bfd..109b232 100644
> --- a/kernel/sched_fair.c
> +++ b/kernel/sched_fair.c
> @@ -1130,6 +1130,10 @@ check_preempt_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr)
>  		return;
>  
>  	se = __pick_first_entity(cfs_rq);
> +
> +	if (!se)
> +		return;
> +
>  	delta = curr->vruntime - se->vruntime;
>  
>  	if (delta < 0)
> -- 
> 1.7.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

-- 
Only stand for myself

  reply	other threads:[~2011-09-16  5:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-16 17:48 [PATCH] cfs: NULL pointer check Wang Xingchao
2011-09-16  5:57 ` Yong Zhang [this message]
2011-09-16  7:42 ` Paul Turner
2011-09-16 21:18   ` xingchao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110916055758.GB10741@zhy \
    --to=yong.zhang0@gmail.com \
    --cc=alex.shi@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=xingchao.wang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox