Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Drivers: hv: utils: Remove util transport handler from list if registration fails

If util transport fails to initialize for any reason, the list of transport
handlers may become corrupted due to freeing the transport handler without
removing it from the list. Fix this by cleaning it up from the list.

Signed-off-by: Alex Ng <alexng@microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Alex Ng and committed by
Greg Kroah-Hartman
e66853b0 b9830d12

+3
+3
drivers/hv/hv_utils_transport.c
··· 310 310 return hvt; 311 311 312 312 err_free_hvt: 313 + spin_lock(&hvt_list_lock); 314 + list_del(&hvt->list); 315 + spin_unlock(&hvt_list_lock); 313 316 kfree(hvt); 314 317 return NULL; 315 318 }