Re: [PATCH net] ptp: Ensure info->enable callback is always set
From: Richard Cochran
Date: Thu Jan 23 2025 - 10:00:51 EST
On Wed, Jan 22, 2025 at 07:39:31PM +0100, Thomas Weißschuh wrote:
> The ioctl and sysfs handlers unconditionally call the ->enable callback.
> Not all drivers implement that callback, leading to NULL dereferences.
> Example of affected drivers: ptp_s390.c, ptp_vclock.c and ptp_mock.c.
>
> Instead use a dummy callback if no better was specified by the driver.
>
> Fixes: d94ba80ebbea ("ptp: Added a brand new class driver for ptp clocks.")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Thomas Weißschuh <linux@xxxxxxxxxxxxxx>
Acked-by: Richard Cochran <richardcochran@xxxxxxxxx>