public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] timer: avoid reading uninitialized data
@ 2009-07-18 20:46 Pavel Roskin
  2009-07-18 21:17 ` [tip:timers/urgent] timer: Avoid " tip-bot for Pavel Roskin
  0 siblings, 1 reply; 2+ messages in thread
From: Pavel Roskin @ 2009-07-18 20:46 UTC (permalink / raw)
  To: linux-kernel; +Cc: Thomas Gleixner

timer->expires may be uninitialized, so check timer_pending() before
touching timer->expires to pacify kmemcheck.

Signed-off-by: Pavel Roskin <proski@gnu.org>
---
 kernel/timer.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/timer.c b/kernel/timer.c
index 0b36b9e..a7f07d5 100644
--- a/kernel/timer.c
+++ b/kernel/timer.c
@@ -714,7 +714,7 @@ int mod_timer(struct timer_list *timer, unsigned long expires)
 	 * networking code - if the timer is re-modified
 	 * to be the same thing then just return:
 	 */
-	if (timer->expires == expires && timer_pending(timer))
+	if (timer_pending(timer) && timer->expires == expires)
 		return 1;
 
 	return __mod_timer(timer, expires, false, TIMER_NOT_PINNED);

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [tip:timers/urgent] timer: Avoid reading uninitialized data
  2009-07-18 20:46 [PATCH] timer: avoid reading uninitialized data Pavel Roskin
@ 2009-07-18 21:17 ` tip-bot for Pavel Roskin
  0 siblings, 0 replies; 2+ messages in thread
From: tip-bot for Pavel Roskin @ 2009-07-18 21:17 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, tglx, proski

Commit-ID:  4841158b26e28e1476eed84c7347c18f11317750
Gitweb:     http://git.kernel.org/tip/4841158b26e28e1476eed84c7347c18f11317750
Author:     Pavel Roskin <proski@gnu.org>
AuthorDate: Sat, 18 Jul 2009 16:46:02 -0400
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Sat, 18 Jul 2009 23:11:43 +0200

timer: Avoid reading uninitialized data

timer->expires may be uninitialized, so check timer_pending() before
touching timer->expires to pacify kmemcheck.

Signed-off-by: Pavel Roskin <proski@gnu.org>
LKML-Reference: <20090718204602.5191.360.stgit@mj.roinet.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>


---
 kernel/timer.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/timer.c b/kernel/timer.c
index 0b36b9e..a7f07d5 100644
--- a/kernel/timer.c
+++ b/kernel/timer.c
@@ -714,7 +714,7 @@ int mod_timer(struct timer_list *timer, unsigned long expires)
 	 * networking code - if the timer is re-modified
 	 * to be the same thing then just return:
 	 */
-	if (timer->expires == expires && timer_pending(timer))
+	if (timer_pending(timer) && timer->expires == expires)
 		return 1;
 
 	return __mod_timer(timer, expires, false, TIMER_NOT_PINNED);

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-07-18 21:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-18 20:46 [PATCH] timer: avoid reading uninitialized data Pavel Roskin
2009-07-18 21:17 ` [tip:timers/urgent] timer: Avoid " tip-bot for Pavel Roskin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox