* [PATCH][RT] Trivial: Correctly dereference when clearing unused variable
@ 2008-11-07 21:19 Sven-Thorsten Dietrich
0 siblings, 0 replies; only message in thread
From: Sven-Thorsten Dietrich @ 2008-11-07 21:19 UTC (permalink / raw)
To: RT Users List; +Cc: LKML, Tony Jones
From: Sven-Thorsten Dietrich <sdietrich@suse.de>
Subject: Correctly dereference flags when clearing unused variable.
Its probably unsafe to set the flags pointer to 0, since this will oops,
if it is dereferenced elsewhere for some odd reason.
Signed-off-by: Sven-Thorsten Dietrich <sdietrich@suse.de>
---
mm/page_alloc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -170,7 +170,7 @@ static inline void __lock_cpu_pcp(unsign
{
#ifdef CONFIG_PREEMPT_RT
spin_lock(&__get_cpu_lock(pcp_locks, cpu));
- flags = 0;
+ *flags = 0;
#else
local_irq_save(*flags);
#endif
@@ -180,7 +180,7 @@ static inline void lock_cpu_pcp(unsigned
{
#ifdef CONFIG_PREEMPT_RT
(void)get_cpu_var_locked(pcp_locks, this_cpu);
- flags = 0;
+ *flags = 0;
#else
local_irq_save(*flags);
*this_cpu = smp_processor_id();
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2008-11-07 21:25 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-07 21:19 [PATCH][RT] Trivial: Correctly dereference when clearing unused variable Sven-Thorsten Dietrich
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).