[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170710071615.k6b6726cwushhdmm@mwanda>
Date: Mon, 10 Jul 2017 10:16:15 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: Ganesh Goudar <ganeshgr@...lsio.com>,
Atul Gupta <atul.gupta@...lsio.com>
Cc: netdev@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: [PATCH 2/2 net] cxgb4: ptp_clock_register() returns error pointers
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@...cle.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;
Powered by blists - more mailing lists