lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20100507100729.a6589d8a.kamezawa.hiroyu@jp.fujitsu.com>
Date:	Fri, 7 May 2010 10:07:29 +0900
From:	KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	Phil Carmody <ext-phil.2.carmody@...ia.com>,
	balbir@...ux.vnet.ibm.com, nishimura@....nes.nec.co.jp,
	kirill@...temov.name, linux-mm@...ck.org,
	linux-kernel@...r.kernel.org, Paul Menage <menage@...gle.com>,
	"lizf@...fujitsu.com" <lizf@...fujitsu.com>
Subject: Re: [PATCH 2/2] mm: memcontrol - uninitialised return value

On Thu, 6 May 2010 14:24:17 -0700
Andrew Morton <akpm@...ux-foundation.org> wrote:

> On Wed,  5 May 2010 14:21:49 +0300
> Phil Carmody <ext-phil.2.carmody@...ia.com> wrote:
> 
> > From: Phil Carmody <ext-phil.2.carmody@...ia.com>
> > 
> > Only an out of memory error will cause ret to be set.
> > 
> > Acked-by: Kirill A. Shutemov <kirill@...temov.name>
> > Signed-off-by: Phil Carmody <ext-phil.2.carmody@...ia.com>
> > ---
> >  mm/memcontrol.c |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> > 
> > diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> > index 90e32b2..09af773 100644
> > --- a/mm/memcontrol.c
> > +++ b/mm/memcontrol.c
> > @@ -3464,7 +3464,7 @@ static int mem_cgroup_unregister_event(struct cgroup *cgrp, struct cftype *cft,
> >  	int type = MEMFILE_TYPE(cft->private);
> >  	u64 usage;
> >  	int size = 0;
> > -	int i, j, ret;
> > +	int i, j, ret = 0;
> >  
> >  	mutex_lock(&memcg->thresholds_lock);
> >  	if (type == _MEM)
> 
> afacit the return value of cftype.unregister_event() is always ignored
> anyway.  Perhaps it should be changed to void-returning, or fixed.
> 
> 
Ah, it's now "TODO". But hmm...."unregister_event()" is called by workqueue.
(for avoiding race?)

I think unregister_event should be "void" and mem_cgroup_unregister_event()
should be implemented as "never fail" function.

I'll try by myself....but if someone knows this event notifier implementation well,
please.

Thanks,
-Kame

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ