mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andreas Schwab <schwab@suse.de>
To: "Rakib Mullick" <rakib.mullick@gmail.com>
Cc: "Paul Menage" <menage@google.com>, "Paul Jackson" <pj@sgi.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] cgroup.c: remove goto statement from cgroup_init.
Date: Mon, 11 Aug 2008 11:32:02 +0200	[thread overview]
Message-ID: <je8wv3dhil.fsf@sykes.suse.de> (raw)
In-Reply-To: <b9df5fa10808110225r2772ab62w155fdec7af5759d8@mail.gmail.com> (Rakib Mullick's message of "Mon, 11 Aug 2008 15:25:51 +0600")

"Rakib Mullick" <rakib.mullick@gmail.com> 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."

  reply	other threads:[~2008-08-11  9:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-11  9:25 Rakib Mullick
2008-08-11  9:32 ` Andreas Schwab [this message]
2008-08-11  9:35 ` Paul Menage

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=je8wv3dhil.fsf@sykes.suse.de \
    --to=schwab@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=menage@google.com \
    --cc=pj@sgi.com \
    --cc=rakib.mullick@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®