netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 4/5] net: sfc: fix return value check in efx_ptp_probe_channel().
       [not found] <1355271894-5284-1-git-send-email-tipecaml@gmail.com>
@ 2012-12-12  0:24 ` Cyril Roelandt
  2012-12-12  5:15   ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Cyril Roelandt @ 2012-12-12  0:24 UTC (permalink / raw)
  To: linux-kernel
  Cc: kernel-janitors, Cyril Roelandt, linux-net-drivers, bhutchings,
	netdev

The ptp_clock_register() returns ERR_PTR() and never returns NULL. Replace the
NULL check by a call to IS_ERR().

Signed-off-by: Cyril Roelandt <tipecaml@gmail.com>
---
 drivers/net/ethernet/sfc/ptp.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/sfc/ptp.c b/drivers/net/ethernet/sfc/ptp.c
index 0767043f..9bcc38c 100644
--- a/drivers/net/ethernet/sfc/ptp.c
+++ b/drivers/net/ethernet/sfc/ptp.c
@@ -930,7 +930,7 @@ static int efx_ptp_probe_channel(struct efx_channel *channel)
 
 	ptp->phc_clock = ptp_clock_register(&ptp->phc_clock_info,
 					    &efx->pci_dev->dev);
-	if (!ptp->phc_clock)
+	if (IS_ERR(ptp->phc_clock))
 		goto fail3;
 
 	INIT_WORK(&ptp->pps_work, efx_ptp_pps_worker);
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 4/5] net: sfc: fix return value check in efx_ptp_probe_channel().
  2012-12-12  0:24 ` [PATCH 4/5] net: sfc: fix return value check in efx_ptp_probe_channel() Cyril Roelandt
@ 2012-12-12  5:15   ` David Miller
  2012-12-21  3:09     ` Ben Hutchings
  0 siblings, 1 reply; 3+ messages in thread
From: David Miller @ 2012-12-12  5:15 UTC (permalink / raw)
  To: tipecaml
  Cc: linux-kernel, kernel-janitors, linux-net-drivers, bhutchings,
	netdev

From: Cyril Roelandt <tipecaml@gmail.com>
Date: Wed, 12 Dec 2012 01:24:53 +0100

> The ptp_clock_register() returns ERR_PTR() and never returns NULL. Replace the
> NULL check by a call to IS_ERR().
> 
> Signed-off-by: Cyril Roelandt <tipecaml@gmail.com>

I'll let Ben queue this up.

Probably he'll want to avoid potentially leaving an ERR_PTR
in ptp->phc_clock even if, with this fix, that would be
harmless.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 4/5] net: sfc: fix return value check in efx_ptp_probe_channel().
  2012-12-12  5:15   ` David Miller
@ 2012-12-21  3:09     ` Ben Hutchings
  0 siblings, 0 replies; 3+ messages in thread
From: Ben Hutchings @ 2012-12-21  3:09 UTC (permalink / raw)
  To: David Miller, tipecaml
  Cc: linux-kernel, kernel-janitors, linux-net-drivers, netdev

On Wed, 2012-12-12 at 00:15 -0500, David Miller wrote:
> From: Cyril Roelandt <tipecaml@gmail.com>
> Date: Wed, 12 Dec 2012 01:24:53 +0100
> 
> > The ptp_clock_register() returns ERR_PTR() and never returns NULL. Replace the
> > NULL check by a call to IS_ERR().
> > 
> > Signed-off-by: Cyril Roelandt <tipecaml@gmail.com>
> 
> I'll let Ben queue this up.
> 
> Probably he'll want to avoid potentially leaving an ERR_PTR
> in ptp->phc_clock even if, with this fix, that would be
> harmless.

Sorry for the delay in looking at this.  This change is fine, as the
entire structure *ptp will be freed on the failure path.

I'm now on vacation until the new year.  Cyril, please re-send your
patch with the addition of:

Acked-by: Ben Hutchings <bhutchings@solarflare.com>

so it will show up on 'patchwork' again and David can apply it from
there.

Ben.

-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-12-21  3:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1355271894-5284-1-git-send-email-tipecaml@gmail.com>
2012-12-12  0:24 ` [PATCH 4/5] net: sfc: fix return value check in efx_ptp_probe_channel() Cyril Roelandt
2012-12-12  5:15   ` David Miller
2012-12-21  3:09     ` Ben Hutchings

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).