ntb.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Dave Jiang <dave.jiang@intel.com>
To: Jinjie Ruan <ruanjinjie@huawei.com>, <ntb@lists.linux.dev>,
	Jon Mason <jdmason@kudzu.us>, Allen Hubbe <allenbh@gmail.com>
Subject: Re: [PATCH] ntb: intel: Fix the NULL vs IS_ERR() bug for debugfs_create_dir()
Date: Thu, 31 Aug 2023 08:00:14 -0700	[thread overview]
Message-ID: <9b3bdb3d-f1bf-4278-479c-20f78493ce7c@intel.com> (raw)
In-Reply-To: <20230831123927.3137364-1-ruanjinjie@huawei.com>



On 8/31/23 05:39, Jinjie Ruan wrote:
> The debugfs_create_dir() function returns error pointers.
> It never returns NULL. So use IS_ERR() to check it.
> 
> Fixes: e26a5843f7f5 ("NTB: Split ntb_hw_intel and ntb_transport drivers")
> Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>

Thank you!

Reviewed-by: Dave Jiang <dave.jiang@intel.com>
> ---
>   drivers/ntb/hw/intel/ntb_hw_gen1.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/ntb/hw/intel/ntb_hw_gen1.c b/drivers/ntb/hw/intel/ntb_hw_gen1.c
> index 9ab836d0d4f1..079b8cd79785 100644
> --- a/drivers/ntb/hw/intel/ntb_hw_gen1.c
> +++ b/drivers/ntb/hw/intel/ntb_hw_gen1.c
> @@ -778,7 +778,7 @@ static void ndev_init_debugfs(struct intel_ntb_dev *ndev)
>   		ndev->debugfs_dir =
>   			debugfs_create_dir(pci_name(ndev->ntb.pdev),
>   					   debugfs_dir);
> -		if (!ndev->debugfs_dir)
> +		if (IS_ERR(ndev->debugfs_dir))
>   			ndev->debugfs_info = NULL;
>   		else
>   			ndev->debugfs_info =

      reply	other threads:[~2023-08-31 15:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-31 12:39 [PATCH] ntb: intel: Fix the NULL vs IS_ERR() bug for debugfs_create_dir() Jinjie Ruan
2023-08-31 15:00 ` Dave Jiang [this message]

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=9b3bdb3d-f1bf-4278-479c-20f78493ce7c@intel.com \
    --to=dave.jiang@intel.com \
    --cc=allenbh@gmail.com \
    --cc=jdmason@kudzu.us \
    --cc=ntb@lists.linux.dev \
    --cc=ruanjinjie@huawei.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).