[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20170711202000.enehgnr4mn54uoug@localhost.localdomain>
Date: Tue, 11 Jul 2017 22:20:00 +0200
From: Richard Cochran <richardcochran@...il.com>
To: Ganesh Goudar <ganeshgr@...lsio.com>
Cc: netdev@...r.kernel.org, davem@...emloft.net,
dan.carpenter@...cle.com, atul.gupta@...lsio.com
Subject: Re: [PATCH net] cxgb4: ptp_clock_register() returns error pointers
On Tue, Jul 11, 2017 at 07:54:38PM +0530, Ganesh Goudar wrote:
> diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_ptp.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_ptp.c
> index 50517cf..06c0de4 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_OR_NULL(adapter->ptp_clock)) {
But here you also need
adapter->ptp_clock = NULL;
> dev_err(adapter->pdev_dev,
> "PTP %s Clock registration has failed\n", __func__);
> return;
because later on you have:
void cxgb4_ptp_stop(struct adapter *adapter)
{
...
if (adapter->ptp_clock) {
ptp_clock_unregister(adapter->ptp_clock);
adapter->ptp_clock = NULL;
}
}
Thanks,
Richard
Powered by blists - more mailing lists