On 8/27/19 12:50 PM, Andrew Lunn wrote:
On Tue, Aug 27, 2019 at 10:39:20AM -0700, Shannon Nelson wrote:
On 8/26/19 7:26 PM, Andrew Lunn wrote:
On Mon, Aug 26, 2019 at 02:33:23PM -0700, Shannon Nelson wrote:
+void ionic_debugfs_add_dev(struct ionic *ionic)
+{
+ struct dentry *dentry;
+
+ dentry = debugfs_create_dir(ionic_bus_info(ionic), ionic_dir);
+ if (IS_ERR_OR_NULL(dentry))
+ return;
+
+ ionic->dentry = dentry;
+}
Hi Shannon
There was recently a big patchset from GregKH which removed all error
checking from drivers calling debugfs calls. I'm pretty sure you don't
need this check here.
With this check I end up either with a valid dentry value or NULL in
ionic->dentry. Without this check I possibly get an error value in
ionic->dentry, which can get used later as the parent dentry to try to make
a new debugfs node.
Hi Shannon
What you should find is that every debugfs function will have
something like:
if (IS_ERR(dentry))
return dentry;
or
if (IS_ERR(parent))
return parent;
If you know of a API which is missing such protection, i'm sure GregKH
would like to know. Especially since he just ripped all such
protection in driver out. Meaning he just broken some drivers if such
IS_ERR() calls are missing in the debugfs core.
Ah, here's the confusion: there's a start_creating() in the tracefs as
well as in the debugfs, and the tracefs code doesn't have all of those
checks.
sln