aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWei Yongjun <[email protected]>2014-01-07 21:11:25 +0800
committerKonrad Rzeszutek Wilk <[email protected]>2014-01-07 09:59:52 -0500
commitbe1403b9e66bea9d64db9198256cb27532a870b1 (patch)
treea205a5df7b764db92d10c29fb5ebd9cd368bf22e
parent89b9e08f186a203c250872a663c9eab09cdc583a (diff)
xen/evtchn_fifo: fix error return code in evtchn_fifo_setup()
Fix to return -ENOMEM from the error handling case instead of 0 (overwrited to 0 by the HYPERVISOR_event_channel_op call), otherwise the error condition cann't be reflected from the return value. Signed-off-by: Wei Yongjun <[email protected]> Signed-off-by: Konrad Rzeszutek Wilk <[email protected]> Reviewed-by: David Vrabel <[email protected]>
-rw-r--r--drivers/xen/events/events_fifo.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/xen/events/events_fifo.c b/drivers/xen/events/events_fifo.c
index e2bf9571f7fe..5b2c039f16c5 100644
--- a/drivers/xen/events/events_fifo.c
+++ b/drivers/xen/events/events_fifo.c
@@ -109,7 +109,7 @@ static int evtchn_fifo_setup(struct irq_info *info)
{
unsigned port = info->evtchn;
unsigned new_array_pages;
- int ret = -ENOMEM;
+ int ret;
new_array_pages = port / EVENT_WORDS_PER_PAGE + 1;
@@ -124,8 +124,10 @@ static int evtchn_fifo_setup(struct irq_info *info)
array_page = event_array[event_array_pages];
if (!array_page) {
array_page = (void *)__get_free_page(GFP_KERNEL);
- if (array_page == NULL)
+ if (array_page == NULL) {
+ ret = -ENOMEM;
goto error;
+ }
event_array[event_array_pages] = array_page;
}