提交 be1403b9 编写于 作者: W Wei Yongjun 提交者: Konrad Rzeszutek Wilk

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: NWei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Reviewed-by: NDavid Vrabel <david.vrabel@citrix.com>
上级 89b9e08f
...@@ -109,7 +109,7 @@ static int evtchn_fifo_setup(struct irq_info *info) ...@@ -109,7 +109,7 @@ static int evtchn_fifo_setup(struct irq_info *info)
{ {
unsigned port = info->evtchn; unsigned port = info->evtchn;
unsigned new_array_pages; unsigned new_array_pages;
int ret = -ENOMEM; int ret;
new_array_pages = port / EVENT_WORDS_PER_PAGE + 1; new_array_pages = port / EVENT_WORDS_PER_PAGE + 1;
...@@ -124,8 +124,10 @@ static int evtchn_fifo_setup(struct irq_info *info) ...@@ -124,8 +124,10 @@ static int evtchn_fifo_setup(struct irq_info *info)
array_page = event_array[event_array_pages]; array_page = event_array[event_array_pages];
if (!array_page) { if (!array_page) {
array_page = (void *)__get_free_page(GFP_KERNEL); array_page = (void *)__get_free_page(GFP_KERNEL);
if (array_page == NULL) if (array_page == NULL) {
ret = -ENOMEM;
goto error; goto error;
}
event_array[event_array_pages] = array_page; event_array[event_array_pages] = array_page;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册