linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Andrew Jeffery <andrew@aj.id.au>,
	Eddie James <eajames@linux.vnet.ibm.com>
Cc: Guenter Roeck <linux@roeck-us.net>,
	Andrew Jeffery <andrew@aj.id.au>,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [PATCH] fsi: occ: fix a NULL vs IS_ERR() check
Date: Mon, 26 Nov 2018 11:11:15 +0300	[thread overview]
Message-ID: <20181126081115.hmsplacwvcdvpvxn@kili.mountain> (raw)

The platform_device_register_full() function doesn't return NULL, it
returns error pointers.

Fixes: 4e01f5644463 ("fsi: Add On-Chip Controller (OCC) driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 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 a2301cea1cbb..d8695f67622f 100644
--- a/drivers/fsi/fsi-occ.c
+++ b/drivers/fsi/fsi-occ.c
@@ -546,7 +546,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;
-- 
2.11.0


             reply	other threads:[~2018-11-26  8:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-26  8:11 Dan Carpenter [this message]
2018-11-26 16:03 ` [PATCH] fsi: occ: fix a NULL vs IS_ERR() check Eddie James

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=20181126081115.hmsplacwvcdvpvxn@kili.mountain \
    --to=dan.carpenter@oracle.com \
    --cc=andrew@aj.id.au \
    --cc=eajames@linux.vnet.ibm.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    /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 NNTP newsgroup(s).