android_kernel_xiaomi_sm8350/drivers/hv
Guilherme G. Piccoli 2133c422a1 Drivers: hv: vmbus: Fix potential crash on module unload
[ Upstream commit 792f232d57ff28bbd5f9c4abe0466b23d5879dc8 ]

The vmbus driver relies on the panic notifier infrastructure to perform
some operations when a panic event is detected. Since vmbus can be built
as module, it is required that the driver handles both registering and
unregistering such panic notifier callback.

After commit 74347a99e73a ("x86/Hyper-V: Unload vmbus channel in hv panic callback")
though, the panic notifier registration is done unconditionally in the module
initialization routine whereas the unregistering procedure is conditionally
guarded and executes only if HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE capability
is set.

This patch fixes that by unconditionally unregistering the panic notifier
in the module's exit routine as well.

Fixes: 74347a99e73a ("x86/Hyper-V: Unload vmbus channel in hv panic callback")
Signed-off-by: Guilherme G. Piccoli <gpiccoli@igalia.com>
Reviewed-by: Michael Kelley <mikelley@microsoft.com>
Link: https://lore.kernel.org/r/20220315203535.682306-1-gpiccoli@igalia.com
Signed-off-by: Wei Liu <wei.liu@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-04-15 14:18:37 +02:00
..
channel_mgmt.c
channel.c
connection.c
hv_balloon.c hv_balloon: rate-limit "Unhandled message" warning 2022-04-15 14:18:15 +02:00
hv_fcopy.c
hv_kvp.c
hv_snapshot.c
hv_trace_balloon.h
hv_trace.c
hv_trace.h
hv_util.c
hv_utils_transport.c
hv_utils_transport.h
hv.c
hyperv_vmbus.h
Kconfig
Makefile
ring_buffer.c
vmbus_drv.c Drivers: hv: vmbus: Fix potential crash on module unload 2022-04-15 14:18:37 +02:00