mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Xu Wang <vulab@iscas.ac.cn>,
	jk@ozlabs.org, joel@jms.id.au, alistair@popple.id.au,
	eajames@linux.ibm.com, linux-fsi@lists.ozlabs.org
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fsi: fsi-occ: fix return value check in occ_probe()
Date: Mon, 20 Jul 2020 07:44:50 -0700	[thread overview]
Message-ID: <7b62ee5d-a96e-bcf4-e62c-c5575f137eb3@roeck-us.net> (raw)
In-Reply-To: <20200713033313.21487-1-vulab@iscas.ac.cn>

On 7/12/20 8:33 PM, Xu Wang wrote:
> In case of error, the function platform_device_register_full()
> returns ERR_PTR() and never returns NULL. The NULL test in the
> return value check should be replaced with IS_ERR().
> 
> Signed-off-by: Xu Wang <vulab@iscas.ac.cn>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
>  drivers/fsi/fsi-occ.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/fsi/fsi-occ.c b/drivers/fsi/fsi-occ.c
> index 7da9c81759ac..9eeb856c8905 100644
> --- a/drivers/fsi/fsi-occ.c
> +++ b/drivers/fsi/fsi-occ.c
> @@ -555,7 +555,7 @@ static int occ_probe(struct platform_device *pdev)
>  
>  	hwmon_dev_info.id = occ->idx;
>  	hwmon_dev = platform_device_register_full(&hwmon_dev_info);
> -	if (!hwmon_dev)
> +	if (IS_ERR(hwmon_dev))
>  		dev_warn(dev, "failed to create hwmon device\n");
>  
>  	return 0;
> 


      parent reply	other threads:[~2020-07-20 14:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-13  3:33 Xu Wang
2020-07-13 14:21 ` Eddie James
2020-07-20 14:44 ` Guenter Roeck [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=7b62ee5d-a96e-bcf4-e62c-c5575f137eb3@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=alistair@popple.id.au \
    --cc=eajames@linux.ibm.com \
    --cc=jk@ozlabs.org \
    --cc=joel@jms.id.au \
    --cc=linux-fsi@lists.ozlabs.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vulab@iscas.ac.cn \
    /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

all inboxes | Powered by JetHome®