LKML Archive on
help / color / mirror / Atom feed
From: Jesper Juhl <>
	Balbir Singh <>,
	Daisuke Nishimura <>,
	KAMEZAWA Hiroyuki <>,
	Pavel Emelianov <>,
	"Kirill A. Shutemov" <>
Subject: [PATCH] Fix uninitialized variable use in mm/memcontrol.c::mem_cgroup_move_parent()
Date: Sat, 22 Jan 2011 20:51:32 +0100 (CET)	[thread overview]
Message-ID: <> (raw)

In mm/memcontrol.c::mem_cgroup_move_parent() there's a path that jumps to 
the 'put_back' label
  	ret = __mem_cgroup_try_charge(NULL, gfp_mask, &parent, false, charge);
  	if (ret || !parent)
  		goto put_back;
 where we'll 
  	if (charge > PAGE_SIZE)
  		compound_unlock_irqrestore(page, flags);
but, we have not assigned anything to 'flags' at this point, nor have we 
called 'compound_lock_irqsave()' (which is what sets 'flags').
So, I believe the 'put_back' label should be moved below the call to 
compound_unlock_irqrestore() as per this patch. 

Signed-off-by: Jesper Juhl <>
 memcontrol.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

  compile tested only.

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index db76ef7..4fcf47a 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -2292,9 +2292,10 @@ static int mem_cgroup_move_parent(struct page_cgroup *pc,
 	ret = mem_cgroup_move_account(pc, child, parent, true, charge);
 	if (ret)
 		mem_cgroup_cancel_charge(parent, charge);
 	if (charge > PAGE_SIZE)
 		compound_unlock_irqrestore(page, flags);

Jesper Juhl <>  
Don't top-post
Plain text mails only, please.

             reply	other threads:[~2011-01-22 19:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-22 19:51 Jesper Juhl [this message]
2011-01-24  0:08 ` KAMEZAWA Hiroyuki

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:

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

  git send-email \ \ \ \ \ \ \ \ \ \
    --subject='Re: [PATCH] Fix uninitialized variable use in mm/memcontrol.c::mem_cgroup_move_parent()' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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).