]> www.infradead.org Git - users/willy/pagecache.git/commit
ptp: vmclock: Don't unregister misc device if it was not registered
authorThomas Weißschuh <thomas.weissschuh@linutronix.de>
Fri, 7 Feb 2025 09:39:04 +0000 (10:39 +0100)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 11 Feb 2025 09:20:52 +0000 (10:20 +0100)
commit39e926c3a21b25af6cae479fbb752f193240ce03
tree62e8ba08b404ae471927c6cdf3c20b1c96843182
parentf7d07cd4f77d77f366c8ffbb8ba8b61f614e5fce
ptp: vmclock: Don't unregister misc device if it was not registered

vmclock_remove() tries to detect the successful registration of the misc
device based on the value of its minor value.
However that check is incorrect if the misc device registration was not
attempted in the first place.

Always initialize the minor number, so the check works properly.

Fixes: 205032724226 ("ptp: Add support for the AMZNC10C 'vmclock' device")
Cc: stable@vger.kernel.org
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Acked-by: Richard Cochran <richardcochran@gmail.com>
Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/ptp/ptp_vmclock.c