From: Sven-Thorsten Dietrich <sven@thebigcorporation.com>
To: RT Users List <linux-rt-users@vger.kernel.org>
Cc: LKML <Linux-kernel@vger.kernel.org>, Tony Jones <tonyj@suse.de>
Subject: [PATCH][RT] Trivial: Correctly dereference when clearing unused variable
Date: Fri, 07 Nov 2008 13:19:42 -0800 [thread overview]
Message-ID: <1226092782.5685.11.camel@dd> (raw)
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();
reply other threads:[~2008-11-07 21:25 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1226092782.5685.11.camel@dd \
--to=sven@thebigcorporation.com \
--cc=Linux-kernel@vger.kernel.org \
--cc=linux-rt-users@vger.kernel.org \
--cc=tonyj@suse.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;
as well as URLs for NNTP newsgroup(s).