Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752644Ab0AZXBd (ORCPT ); Tue, 26 Jan 2010 18:01:33 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751916Ab0AZXBc (ORCPT ); Tue, 26 Jan 2010 18:01:32 -0500 Received: from smtp-out.google.com ([216.239.33.17]:41521 "EHLO smtp-out.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751012Ab0AZXBc convert rfc822-to-8bit (ORCPT ); Tue, 26 Jan 2010 18:01:32 -0500 DomainKey-Signature: a=rsa-sha1; s=beta; d=google.com; c=nofws; q=dns; h=mime-version:in-reply-to:references:date:message-id:subject:from:to: cc:content-type:content-transfer-encoding:x-system-of-record; b=LYF17cCRtjzlYRiw10HWlfk2naaoq68eGw4Y4Xe4KBQkP4flnzSp0bDBWKGfaI3An m/gxZdWymmuWtEmPzffdw== MIME-Version: 1.0 In-Reply-To: <4B5EA4EC.8020700@cn.fujitsu.com> References: <4B5EA4EC.8020700@cn.fujitsu.com> Date: Tue, 26 Jan 2010 15:01:26 -0800 Message-ID: <6599ad831001261501q2e6e54bckebb3d2d225ecc126@mail.gmail.com> Subject: Re: [PATCH 1/2] cgroups: Fix to return errno in a failure path From: Paul Menage To: Li Zefan Cc: Andrew Morton , KAMEZAWA Hiroyuki , LKML , "containers@lists.osdl.org" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT X-System-Of-Record: true Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1399 Lines: 38 On Tue, Jan 26, 2010 at 12:16 AM, Li Zefan wrote: > > Signed-off-by: Li Zefan Acked-by: Paul Menage > --- > ?cgroup.c | ? ?7 +++++-- > ?1 file changed, 5 insertions(+), 2 deletions(-) > > --- a/kernel/cgroup.c.orig ? ? ?2010-01-19 16:37:37.000000000 +0800 > +++ a/kernel/cgroup.c ? 2010-01-19 16:39:07.000000000 +0800 > @@ -3279,14 +3279,17 @@ static long cgroup_create(struct cgroup > > ? ? ? ?for_each_subsys(root, ss) { > ? ? ? ? ? ? ? ?struct cgroup_subsys_state *css = ss->create(ss, cgrp); > + > ? ? ? ? ? ? ? ?if (IS_ERR(css)) { > ? ? ? ? ? ? ? ? ? ? ? ?err = PTR_ERR(css); > ? ? ? ? ? ? ? ? ? ? ? ?goto err_destroy; > ? ? ? ? ? ? ? ?} > ? ? ? ? ? ? ? ?init_cgroup_css(css, ss, cgrp); > - ? ? ? ? ? ? ? if (ss->use_id) > - ? ? ? ? ? ? ? ? ? ? ? if (alloc_css_id(ss, parent, cgrp)) > + ? ? ? ? ? ? ? if (ss->use_id) { > + ? ? ? ? ? ? ? ? ? ? ? err = alloc_css_id(ss, parent, cgrp); > + ? ? ? ? ? ? ? ? ? ? ? if (err) > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?goto err_destroy; > + ? ? ? ? ? ? ? } > ? ? ? ? ? ? ? ?/* At error, ->destroy() callback has to free assigned ID. */ > ? ? ? ?} > > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/