libs/evtchn: Remove active handler on clean-up or failure
authorJulien Grall <julien.grall@linaro.org>
Fri, 10 Nov 2017 17:10:50 +0000 (17:10 +0000)
committerWei Liu <wei.liu2@citrix.com>
Tue, 14 Nov 2017 13:54:29 +0000 (13:54 +0000)
commit0de212b03066571523f3174535bb4fb1264ca1de
tree2da66528452911447637893cd75f7ac18b525648
parent20ed7c8177da2847d65bb3373c6f1263671322d4
libs/evtchn: Remove active handler on clean-up or failure

Commit 89d55473ed16543044a31d1e0d4660cf5a3f49df "xentoolcore_restrict_all:
Implement for libxenevtchn" added a call to register allowing to
restrict the event channel.

However, the call to deregister the handler was not performed if open
failed or when closing the event channel. This will result to corrupt
the list of handlers and potentially crash the application later one.

Fix it by calling xentoolcore_deregister_active_handle on failure and
closure.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Release-acked-by: Julien Grall <julien.grall@linaro.org>
tools/libs/evtchn/core.c