Skip to content

Commit d434741

Browse files
michichNipaLocal
authored andcommitted
iavf: Implement settime64 with -EOPNOTSUPP
ptp_clock_settime() assumes every ptp_clock has implemented settime64(). Stub it with -EOPNOTSUPP to prevent a NULL dereference. The fix is similar to commit 329d050 ("gve: Implement settime64 with -EOPNOTSUPP"). Fixes: d734223 ("iavf: add initial framework for registering PTP clock") Signed-off-by: Michal Schmidt <mschmidt@redhat.com> Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com> Reviewed-by: Tim Hostetler <thostet@google.com> Signed-off-by: NipaLocal <nipa@local>
1 parent 7334708 commit d434741

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/net/ethernet/intel/iavf/iavf_ptp.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,12 @@ static int iavf_ptp_gettimex64(struct ptp_clock_info *info,
252252
return iavf_read_phc_indirect(adapter, ts, sts);
253253
}
254254

255+
static int iavf_ptp_settime64(struct ptp_clock_info *info,
256+
const struct timespec64 *ts)
257+
{
258+
return -EOPNOTSUPP;
259+
}
260+
255261
/**
256262
* iavf_ptp_cache_phc_time - Cache PHC time for performing timestamp extension
257263
* @adapter: private adapter structure
@@ -320,6 +326,7 @@ static int iavf_ptp_register_clock(struct iavf_adapter *adapter)
320326
KBUILD_MODNAME, dev_name(dev));
321327
ptp_info->owner = THIS_MODULE;
322328
ptp_info->gettimex64 = iavf_ptp_gettimex64;
329+
ptp_info->settime64 = iavf_ptp_settime64;
323330
ptp_info->do_aux_work = iavf_ptp_do_aux_work;
324331

325332
clock = ptp_clock_register(ptp_info, dev);

0 commit comments

Comments
 (0)