lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 18 Jul 2012 11:50:30 -0700
From:	Anton Vorontsov <anton.vorontsov@...aro.org>
To:	Stephen Boyd <sboyd@...eaurora.org>
Cc:	Steven Rostedt <rostedt@...dmis.org>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Kees Cook <keescook@...omium.org>,
	Colin Cross <ccross@...roid.com>,
	Tony Luck <tony.luck@...el.com>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Ingo Molnar <mingo@...hat.com>, Arnd Bergmann <arnd@...db.de>,
	John Stultz <john.stultz@...aro.org>,
	Shuah Khan <shuahkhan@...il.com>, arve@...roid.com,
	Rebecca Schultz Zavin <rebecca@...roid.com>,
	Jesper Juhl <jj@...osbits.net>,
	Randy Dunlap <rdunlap@...otime.net>,
	Thomas Meyer <thomas@...3r.de>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Marco Stornelli <marco.stornelli@...il.com>,
	WANG Cong <xiyou.wangcong@...il.com>,
	linux-kernel@...r.kernel.org, devel@...verdev.osuosl.org,
	linaro-kernel@...ts.linaro.org, patches@...aro.org,
	kernel-team@...roid.com
Subject: Re: [PATCH] pstore/ftrace: Convert to its own enable/disable debugfs
 knob

On Wed, Jul 18, 2012 at 10:12:44AM -0700, Stephen Boyd wrote:
> On 07/17/12 20:47, Anton Vorontsov wrote:
> > +
> > +	file = debugfs_create_file("record_ftrace", 0600, dir, NULL,
> > +				   &pstore_knob_fops);
> > +	if (IS_ERR_OR_NULL(file)) {
> > +		err = PTR_ERR(file);
> > +		pr_err("%s: unable to create pstore/ftrace file: %d\n",
> > +		       __func__, err);
> > +		goto err_file;
> > +	}
> 
> debugfs only returns NULL on failure.

Well, techincally, with DEBUG_FS=y, yes. (And we have dependency on
it.)

But see include/linux/debugfs.h for DEBUG_FS=n case:

static inline struct dentry *debugfs_create_file(const char *name, umode_t mode,
                                        struct dentry *parent, void *data,
                                        const struct file_operations *fops)
{
        return ERR_PTR(-ENODEV);
}

So, I think it is fine to check for IS_ERR_OR_NULL(), although today
it's always NULL for our case, true.

Thanks,

-- 
Anton Vorontsov
Email: cbouatmailru@...il.com
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ