projects
/
platform
/
kernel
/
linux-rpi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
18283ea
)
xen: close evtchn port if binding to irq fails
author
Wei Liu
<wei.liu2@citrix.com>
Mon, 18 Feb 2013 14:57:58 +0000
(14:57 +0000)
committer
Konrad Rzeszutek Wilk
<konrad.wilk@oracle.com>
Wed, 20 Feb 2013 03:02:33 +0000
(22:02 -0500)
CC: stable@vger.kernel.org
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
drivers/xen/evtchn.c
patch
|
blob
|
history
diff --git
a/drivers/xen/evtchn.c
b/drivers/xen/evtchn.c
index
4ebd501
..
45c8efa
100644
(file)
--- a/
drivers/xen/evtchn.c
+++ b/
drivers/xen/evtchn.c
@@
-269,6
+269,14
@@
static int evtchn_bind_to_user(struct per_user_data *u, int port)
u->name, (void *)(unsigned long)port);
if (rc >= 0)
rc = evtchn_make_refcounted(port);
+ else {
+ /* bind failed, should close the port now */
+ struct evtchn_close close;
+ close.port = port;
+ if (HYPERVISOR_event_channel_op(EVTCHNOP_close, &close) != 0)
+ BUG();
+ set_port_user(port, NULL);
+ }
return rc;
}
@@
-277,6
+285,8
@@
static void evtchn_unbind_from_user(struct per_user_data *u, int port)
{
int irq = irq_from_evtchn(port);
+ BUG_ON(irq < 0);
+
unbind_from_irqhandler(irq, (void *)(unsigned long)port);
set_port_user(port, NULL);