Re: [PATCH -next] crypto: qat - remove redundant null pointer checks in adf_dbgfs_init()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Sep 14, 2024 at 04:40:05PM +0800, Herbert Xu wrote:
> On Fri, Sep 13, 2024 at 03:52:52PM +0100, Cabiddu, Giovanni wrote:
> >
> > As I understand it, there is no need to check the return value of
> > debugfs_create_*() functions. See f0fcf9ade46a ("crypto: qat - no need to check
> > return value of debugfs_create functions"), where all checks after the
> > debugfs_create_*() were removed.
> 
> Right.
> 
> > In this particular case, the check is present only to avoid attempting to
> > create attributes if the directory is missing, since we know such an
> > attempt will fail.
> 
> I think this is still buggy.  That if statement should be removed
> as otherwise subsequent calls to debugfs_create_file will provide a
> NULL parent dentry instead of an error parent dentry.  This causes
> debugfs to do things differently.

debugfs, if something goes wrong, will return a real error, never NULL,
so any return value from a call can be passed back in.

Ideally I want to make debugfs return values just a "opaque token" so
please just treat it like that (and ignore the fact that it's a dentry.)

thanks,

greg k-h




[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]
  Powered by Linux