public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: Jan Engelhardt <jengelh@linux01.gwdg.de>
Cc: "Serge E. Hallyn" <serge@hallyn.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: securityfs_create_dir strange comment
Date: Wed, 21 Feb 2007 09:29:49 -0800	[thread overview]
Message-ID: <20070221172949.GA16029@kroah.com> (raw)
In-Reply-To: <Pine.LNX.4.61.0702211805450.12039@yvahk01.tjqt.qr>

On Wed, Feb 21, 2007 at 06:07:56PM +0100, Jan Engelhardt wrote:
> Hello Greg,
> 
> 
> On Feb 20 2007 20:05, Greg KH wrote:
> >
> >Try this instead:
> >	if (!de)
> >		return -ENOMEM;
> >	if ((IS_ERR(de)) && (PTR_ERR(de) != -ENODEV))
> >		return PTR_ERR(de);
> >	return 0;
> >
> >That should cover everything properly, right?
> 
> In case memory could not be allocated, why does not securityfs_*() return
> ERR_PTR(-ENOMEM) then? (I think, that's the quintessential question after
> all. And thanks for giving an example what to do in the ENODEV case.)

Actually, in reading the code (which might have helped in the first
place), we can never return NULL if securityfs is enabled.  So you can
just drop that first check entirely.

Which makes me wonder, it might be easier to just return NULL if
securityfs is not enabled in the kernel, as long as no one checks that
improperly...

Hope this helps,

greg k-h

  reply	other threads:[~2007-02-21 17:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-18 15:45 securityfs_create_dir strange comment Jan Engelhardt
2007-02-20 21:18 ` Serge E. Hallyn
2007-02-20 22:26   ` Greg KH
2007-02-20 23:45     ` Jan Engelhardt
2007-02-21  4:05       ` Greg KH
2007-02-21 17:07         ` Jan Engelhardt
2007-02-21 17:29           ` Greg KH [this message]
2007-02-21 17:46             ` Jan Engelhardt

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=20070221172949.GA16029@kroah.com \
    --to=greg@kroah.com \
    --cc=jengelh@linux01.gwdg.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=serge@hallyn.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