Commit 03dc7d81 authored by Alex Ng's avatar Alex Ng Committed by Tim Gardner

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

BugLink: http://bugs.launchpad.net/bugs/1541585

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: default avatarAlex Ng <alexng@microsoft.com>
Signed-off-by: default avatarK. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit e66853b0)
Signed-off-by: default avatarTim Gardner <tim.gardner@canonical.com>
parent 3107561e
......@@ -310,6 +310,9 @@ struct hvutil_transport *hvutil_transport_init(const char *name,
return hvt;
err_free_hvt:
spin_lock(&hvt_list_lock);
list_del(&hvt->list);
spin_unlock(&hvt_list_lock);
kfree(hvt);
return NULL;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment