Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752302AbYHKJcR (ORCPT ); Mon, 11 Aug 2008 05:32:17 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751079AbYHKJcE (ORCPT ); Mon, 11 Aug 2008 05:32:04 -0400 Received: from cantor.suse.de ([195.135.220.2]:55239 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751025AbYHKJcE (ORCPT ); Mon, 11 Aug 2008 05:32:04 -0400 From: Andreas Schwab To: "Rakib Mullick" Cc: "Paul Menage" , "Paul Jackson" , linux-kernel@vger.kernel.org Subject: Re: [PATCH] cgroup.c: remove goto statement from cgroup_init. References: X-Yow: I think my CAREER is RUINED!! Date: Mon, 11 Aug 2008 11:32:02 +0200 In-Reply-To: (Rakib Mullick's message of "Mon, 11 Aug 2008 15:25:51 +0600") Message-ID: User-Agent: Gnus/5.110009 (No Gnus v0.9) Emacs/22.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1190 Lines: 37 "Rakib Mullick" writes: > Hello everyone, following patch removes the use of goto statement. > Actually, we don't need it. Beacuse, if "err < 0", then it will never > be TRUE. What is "it"? > --- linux-2.6.27-rc2.orig/kernel/cgroup.c 2008-08-11 15:16:49.000000000 +0600 > +++ linux-2.6.27-rc2/kernel/cgroup.c 2008-08-11 15:16:26.000000000 +0600 > @@ -2562,11 +2562,10 @@ int __init cgroup_init(void) > > err = register_filesystem(&cgroup_fs_type); > if (err < 0) > - goto out; > + return err; > > proc_create("cgroups", 0, NULL, &proc_cgroupstats_operations); > > -out: > if (err) > bdi_destroy(&cgroup_backing_dev_info); Doesn't this create a resource leak? Andreas. -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE Linux Products GmbH, Maxfeldstra?e 5, 90409 N?rnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." -- 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/