Skip to content

Commit 01534d7

Browse files
committed
Merge branch 'gve-fix-null-dereferencing-with-ptp-clock'
Tim Hostetler says: ==================== gve: Fix NULL dereferencing with PTP clock This patch series fixes NULL dereferences that are possible with gve's PTP clock due to not stubbing certain ptp_clock_info callbacks. ==================== Link: https://patch.msgid.link/20251029184555.3852952-1-joshwash@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 parents 284987a + 329d050 commit 01534d7

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

drivers/net/ethernet/google/gve/gve_ptp.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,19 @@ int gve_clock_nic_ts_read(struct gve_priv *priv)
2626
return 0;
2727
}
2828

29+
static int gve_ptp_gettimex64(struct ptp_clock_info *info,
30+
struct timespec64 *ts,
31+
struct ptp_system_timestamp *sts)
32+
{
33+
return -EOPNOTSUPP;
34+
}
35+
36+
static int gve_ptp_settime64(struct ptp_clock_info *info,
37+
const struct timespec64 *ts)
38+
{
39+
return -EOPNOTSUPP;
40+
}
41+
2942
static long gve_ptp_do_aux_work(struct ptp_clock_info *info)
3043
{
3144
const struct gve_ptp *ptp = container_of(info, struct gve_ptp, info);
@@ -47,6 +60,8 @@ static long gve_ptp_do_aux_work(struct ptp_clock_info *info)
4760
static const struct ptp_clock_info gve_ptp_caps = {
4861
.owner = THIS_MODULE,
4962
.name = "gve clock",
63+
.gettimex64 = gve_ptp_gettimex64,
64+
.settime64 = gve_ptp_settime64,
5065
.do_aux_work = gve_ptp_do_aux_work,
5166
};
5267

0 commit comments

Comments
 (0)