public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Jiang <dave.jiang@intel.com>
To: Lin Yujun <linyujun809@h-partners.com>,
	dan.j.williams@intel.com, vishal.l.verma@intel.com,
	ira.weiny@intel.com, santosh@fossix.org
Cc: nvdimm@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH -next] ndtest: Fix incorrect handling for return value of device_create_with_groups.
Date: Mon, 8 Sep 2025 10:47:59 -0700	[thread overview]
Message-ID: <46992d97-e803-4d7e-b951-1a2a9d1b6987@intel.com> (raw)
In-Reply-To: <20250908122331.1315530-1-linyujun809@h-partners.com>



On 9/8/25 5:23 AM, Lin Yujun wrote:
> The return value of device_create_with_groups will not
> be an null pointer, use IS_ERR() to fix incorrect handling
> return value of device_create_with_groups.
> 
> Fixes: 9399ab61ad82 ("ndtest: Add dimms to the two buses")
> Signed-off-by: Lin Yujun <linyujun809@h-partners.com>

Reviewed-by: Dave Jiang <dave.jiang@intel.com>
> ---
>  tools/testing/nvdimm/test/ndtest.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/testing/nvdimm/test/ndtest.c b/tools/testing/nvdimm/test/ndtest.c
> index 68a064ce598c..7d722f2f7d62 100644
> --- a/tools/testing/nvdimm/test/ndtest.c
> +++ b/tools/testing/nvdimm/test/ndtest.c
> @@ -745,11 +745,11 @@ static int ndtest_dimm_register(struct ndtest_priv *priv,
>  
>  	dimm->dev = device_create_with_groups(&ndtest_dimm_class,
>  					     &priv->pdev.dev,
>  					     0, dimm, dimm_attribute_groups,
>  					     "test_dimm%d", id);
> -	if (!dimm->dev) {
> +	if (IS_ERR(dimm->dev)) {
>  		pr_err("Could not create dimm device attributes\n");
>  		return -ENOMEM;
>  	}
>  
>  	return 0;


      reply	other threads:[~2025-09-08 17:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-08 12:23 [PATCH -next] ndtest: Fix incorrect handling for return value of device_create_with_groups Lin Yujun
2025-09-08 17:47 ` 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=46992d97-e803-4d7e-b951-1a2a9d1b6987@intel.com \
    --to=dave.jiang@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=ira.weiny@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linyujun809@h-partners.com \
    --cc=nvdimm@lists.linux.dev \
    --cc=santosh@fossix.org \
    --cc=vishal.l.verma@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