Commit 40fbbce0 authored by Ganesh Goudar's avatar Ganesh Goudar Committed by David S. Miller
Browse files

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: 9c33e420

 ("cxgb4: Add PTP Hardware Clock (PHC) support")
Reported-by: default avatarDan Carpenter <>
Cc: Richard Cochran <>
Signed-off-by: default avatarGanesh Goudar <>
Signed-off-by: default avatarDavid S. Miller <>
parent 1e4babee
......@@ -441,7 +441,8 @@ void cxgb4_ptp_init(struct adapter *adapter)
adapter->ptp_clock = ptp_clock_register(&adapter->ptp_clock_info,
if (!adapter->ptp_clock) {
if (IS_ERR_OR_NULL(adapter->ptp_clock)) {
adapter->ptp_clock = NULL;
"PTP %s Clock registration has failed\n", __func__);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment