From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: "Cabiddu, Giovanni" <giovanni.cabiddu@intel.com>,
Li Zetao <lizetao1@huawei.com>,
davem@davemloft.net, lucas.segarra.fernandez@intel.com,
damian.muszynski@intel.com, qat-linux@intel.com,
linux-crypto@vger.kernel.org
Subject: Re: [PATCH -next] crypto: qat - remove redundant null pointer checks in adf_dbgfs_init()
Date: Sat, 14 Sep 2024 10:50:33 +0200 [thread overview]
Message-ID: <2024091452-freight-irritant-f160@gregkh> (raw)
In-Reply-To: <ZuVL5buxgkqSEzPU@gondor.apana.org.au>
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
next prev parent reply other threads:[~2024-09-14 8:50 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-03 14:42 [PATCH -next] crypto: qat - remove redundant null pointer checks in adf_dbgfs_init() Li Zetao
2024-09-13 10:19 ` Herbert Xu
2024-09-13 14:52 ` Cabiddu, Giovanni
2024-09-14 8:40 ` Herbert Xu
2024-09-14 8:50 ` Greg Kroah-Hartman [this message]
2024-09-14 11:40 ` Herbert Xu
2024-09-14 13:58 ` Greg Kroah-Hartman
2024-09-16 9:42 ` [PATCH] crypto: qat - remove check after debugfs_create_dir() Cabiddu, Giovanni
2024-10-05 5:32 ` Herbert Xu
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=2024091452-freight-irritant-f160@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=damian.muszynski@intel.com \
--cc=davem@davemloft.net \
--cc=giovanni.cabiddu@intel.com \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
--cc=lizetao1@huawei.com \
--cc=lucas.segarra.fernandez@intel.com \
--cc=qat-linux@intel.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