Skip to content

Commit c0b4ddd

Browse files
jacob-kellerPaolo Abeni
authored andcommitted
net: lan743x: reject unsupported external timestamp requests
The lan743x_ptp_io_event_cap_en() function checks that the given request sets only one of PTP_RISING_EDGE or PTP_FALLING_EDGE, but not both. However, this driver does not check whether other flags (such as PTP_EXT_OFF) are set, nor whether any future unrecognized flags are set. Fix this by adding the appropriate check to the lan743x_ptp_io_extts() function. Fixes: 60942c3 ("net: lan743x: Add support for PTP-IO Event Input External Timestamp (extts)") Signed-off-by: Jacob Keller <[email protected]> Reviewed-by: Simon Horman <[email protected]> Link: https://patch.msgid.link/20250312-jk-net-fixes-supported-extts-flags-v2-3-ea930ba82459@intel.com Signed-off-by: Paolo Abeni <[email protected]>
1 parent 51d58c0 commit c0b4ddd

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/net/ethernet/microchip/lan743x_ptp.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -942,6 +942,12 @@ static int lan743x_ptp_io_extts(struct lan743x_adapter *adapter, int on,
942942

943943
extts = &ptp->extts[index];
944944

945+
if (extts_request->flags & ~(PTP_ENABLE_FEATURE |
946+
PTP_RISING_EDGE |
947+
PTP_FALLING_EDGE |
948+
PTP_STRICT_FLAGS))
949+
return -EOPNOTSUPP;
950+
945951
if (on) {
946952
extts_pin = ptp_find_pin(ptp->ptp_clock, PTP_PF_EXTTS, index);
947953
if (extts_pin < 0)

0 commit comments

Comments
 (0)