From: tip-bot for Juri Lelli <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@kernel.org,
peterz@infradead.org, tglx@linutronix.de,
dan.carpenter@oracle.com, juri.lelli@gmail.com
Subject: [tip:sched/core] sched/deadline: No need to check p if dl_se is valid
Date: Thu, 16 Jan 2014 05:40:01 -0800 [thread overview]
Message-ID: <tip-71362650b555a5b24c732e455484cc7cac1c8588@git.kernel.org> (raw)
In-Reply-To: <52D54E25.6060100@gmail.com>
Commit-ID: 71362650b555a5b24c732e455484cc7cac1c8588
Gitweb: http://git.kernel.org/tip/71362650b555a5b24c732e455484cc7cac1c8588
Author: Juri Lelli <juri.lelli@gmail.com>
AuthorDate: Tue, 14 Jan 2014 12:03:51 +0100
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Thu, 16 Jan 2014 09:27:11 +0100
sched/deadline: No need to check p if dl_se is valid
Dan Carpenter reported new 'Smatch' warnings:
> tree: git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git sched/core
> head: 130816ce4d5f69167324f7272e70aa3d641677c6
> commit: 1baca4ce16b8cc7d4f50be1f7914799af30a2861 [17/50] sched/deadline: Add SCHED_DEADLINE SMP-related data structures & logic
>
> kernel/sched/deadline.c:937 pick_next_task_dl() warn: variable dereferenced before check 'p' (see line 934)
BUG_ON() already fires if pick_next_dl_entity() doesn't return a valid
dl_se. No need to check if p is valid afterward.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Juri Lelli <juri.lelli@gmail.com>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Fixes: 1baca4ce16b8 ("sched/deadline: Add SCHED_DEADLINE SMP-related data structures & logic")
Link: http://lkml.kernel.org/r/52D54E25.6060100@gmail.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
kernel/sched/deadline.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
index ee25361..0de2482 100644
--- a/kernel/sched/deadline.c
+++ b/kernel/sched/deadline.c
@@ -1007,8 +1007,7 @@ struct task_struct *pick_next_task_dl(struct rq *rq)
p->se.exec_start = rq_clock_task(rq);
/* Running task will never be pushed. */
- if (p)
- dequeue_pushable_dl_task(rq, p);
+ dequeue_pushable_dl_task(rq, p);
#ifdef CONFIG_SCHED_HRTICK
if (hrtick_enabled(rq))
parent reply other threads:[~2014-01-16 13:40 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <52D54E25.6060100@gmail.com>]
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=tip-71362650b555a5b24c732e455484cc7cac1c8588@git.kernel.org \
--to=tipbot@zytor.com \
--cc=dan.carpenter@oracle.com \
--cc=hpa@zytor.com \
--cc=juri.lelli@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
/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
Powered by JetHome