All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Ganesh Goudar <ganeshgr@chelsio.com>,
	Atul Gupta <atul.gupta@chelsio.com>
Cc: netdev@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [PATCH 2/2 net] cxgb4: ptp_clock_register() returns error pointers
Date: Mon, 10 Jul 2017 10:16:15 +0300	[thread overview]
Message-ID: <20170710071615.k6b6726cwushhdmm@mwanda> (raw)
In-Reply-To: <20170710071137.ui2fhjkqzjqhkopz@mwanda>

We're checking ptp_clock_register() for NULL but we should be checking
for error pointers.

Fixes: 9c33e4208bce ("cxgb4: Add PTP Hardware Clock (PHC) support")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_ptp.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_ptp.c
index 50517cfd9671..c24313a103c6 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_ptp.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_ptp.c
@@ -441,7 +441,7 @@ void cxgb4_ptp_init(struct adapter *adapter)
 
 	adapter->ptp_clock = ptp_clock_register(&adapter->ptp_clock_info,
 						&adapter->pdev->dev);
-	if (!adapter->ptp_clock) {
+	if (IS_ERR(adapter->ptp_clock)) {
 		dev_err(adapter->pdev_dev,
 			"PTP %s Clock registration has failed\n", __func__);
 		return;

WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Ganesh Goudar <ganeshgr@chelsio.com>,
	Atul Gupta <atul.gupta@chelsio.com>
Cc: netdev@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [PATCH 2/2 net] cxgb4: ptp_clock_register() returns error pointers
Date: Mon, 10 Jul 2017 07:16:15 +0000	[thread overview]
Message-ID: <20170710071615.k6b6726cwushhdmm@mwanda> (raw)
In-Reply-To: <20170710071137.ui2fhjkqzjqhkopz@mwanda>

We're checking ptp_clock_register() for NULL but we should be checking
for error pointers.

Fixes: 9c33e4208bce ("cxgb4: Add PTP Hardware Clock (PHC) support")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_ptp.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_ptp.c
index 50517cfd9671..c24313a103c6 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_ptp.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_ptp.c
@@ -441,7 +441,7 @@ void cxgb4_ptp_init(struct adapter *adapter)
 
 	adapter->ptp_clock = ptp_clock_register(&adapter->ptp_clock_info,
 						&adapter->pdev->dev);
-	if (!adapter->ptp_clock) {
+	if (IS_ERR(adapter->ptp_clock)) {
 		dev_err(adapter->pdev_dev,
 			"PTP %s Clock registration has failed\n", __func__);
 		return;

  reply	other threads:[~2017-07-10  7:16 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-10  7:11 [PATCH 1/2 net] ptp: fix error codes in ptp_clock_register() Dan Carpenter
2017-07-10  7:11 ` Dan Carpenter
2017-07-10  7:16 ` Dan Carpenter [this message]
2017-07-10  7:16   ` [PATCH 2/2 net] cxgb4: ptp_clock_register() returns error pointers Dan Carpenter
2017-07-10  9:56   ` Richard Cochran
2017-07-10  9:56     ` Richard Cochran
2017-07-10  9:21 ` [PATCH 1/2 net] ptp: fix error codes in ptp_clock_register() Richard Cochran
2017-07-10  9:21   ` Richard Cochran
2017-07-10  9:38   ` Dan Carpenter
2017-07-10  9:38     ` Dan Carpenter
2017-07-10  9:48     ` Richard Cochran
2017-07-10  9:48       ` Richard Cochran
2017-07-10 10:29       ` Dan Carpenter
2017-07-10 10:29         ` Dan Carpenter
2017-07-10 11:02         ` Richard Cochran
2017-07-10 11:02           ` Richard Cochran
2017-07-10  9:34 ` Richard Cochran
2017-07-10  9:34   ` Richard Cochran

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=20170710071615.k6b6726cwushhdmm@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=atul.gupta@chelsio.com \
    --cc=ganeshgr@chelsio.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.