[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.02.1401301301000.15271@chino.kir.corp.google.com>
Date: Thu, 30 Jan 2014 13:09:52 -0800 (PST)
From: David Rientjes <rientjes@...gle.com>
To: Vladimir Davydov <vdavydov@...allels.com>
cc: akpm@...ux-foundation.org, mhocko@...e.cz, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] memcg: fix mutex not unlocked on memcg_create_kmem_cache
fail path
On Thu, 30 Jan 2014, Vladimir Davydov wrote:
> Signed-off-by: Vladimir Davydov <vdavydov@...allels.com>
Some changelog would be helpful since this fixes an issue already in
Linus's tree.
Commit 842e2873697e ("memcg: get rid of kmem_cache_dup()") introduced a
mutex for memcg_create_kmem_cache() to protect the tmp_name buffer that
holds the memcg name. It failed to unlock the mutex if this buffer could
not be allocated.
This patch fixes the issue by appropriately unlocking the mutex if the
allocation fails.
Acked-by: David Rientjes <rientjes@...gle.com>
That said, this tmp_name stuff seems totally unnecessary.
kmem_cache_create_memcg() already does the kstrdup() so why not just pass
in a pointer to already allocated memory for s->name rather than having
this mutex or global buffer at all?
--
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