android_kernel_motorola_sm6375/drivers/ptp
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Thomas Weißschuh fdc1e72487 ptp: Ensure info->enable callback is always set
commit fd53aa40e65f518453115b6f56183b0c201db26b upstream.

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: d94ba80ebb ("ptp: Added a brand new class driver for ptp clocks.")
Cc: stable@vger.kernel.org
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Acked-by: Richard Cochran <richardcochran@gmail.com>
Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Link: https://patch.msgid.link/20250123-ptp-enable-v1-1-b015834d3a47@weissschuh.net
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-03-13 12:43:11 +01:00
..
Kconfig
Makefile
ptp_chardev.c ptp: Fix error message on failed pin verification 2024-07-05 09:08:11 +02:00
ptp_clock.c ptp: Ensure info->enable callback is always set 2025-03-13 12:43:11 +01:00
ptp_dte.c
ptp_ixp46x.c
ptp_kvm.c
ptp_pch.c
ptp_private.h
ptp_qoriq.c
ptp_qoriq_debugfs.c
ptp_sysfs.c