cxgb4: ptp_clock_register() returns error pointers
authorGanesh Goudar <ganeshgr@chelsio.com>
Thu, 13 Jul 2017 13:06:50 +0000 (18:36 +0530)
committerDavid S. Miller <davem@davemloft.net>
Fri, 14 Jul 2017 15:18:51 +0000 (08:18 -0700)
commit40fbbce007cb458da4c15cbf53beacf6b755cedc
tree8da76ad10249fd6156c9f85f580c59f4b0ee69fb
parent1e4babee70a2e2d8f9e0da06f013563b0e26f654
cxgb4: ptp_clock_register() returns error pointers

Check ptp_clock_register() return not only for NULL but
also for error pointers, and also nullify adapter->ptp_clock
if ptp_clock_register() fails.

Fixes: 9c33e4208bce ("cxgb4: Add PTP Hardware Clock (PHC) support")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: Ganesh Goudar <ganeshgr@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/chelsio/cxgb4/cxgb4_ptp.c