diff options
author | Wei Yongjun <yongjun_wei@trendmicro.com.cn> | 2014-01-07 08:11:25 -0500 |
---|---|---|
committer | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2014-01-07 09:59:52 -0500 |
commit | be1403b9e66bea9d64db9198256cb27532a870b1 (patch) | |
tree | a205a5df7b764db92d10c29fb5ebd9cd368bf22e /drivers/xen | |
parent | 89b9e08f186a203c250872a663c9eab09cdc583a (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 <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Reviewed-by: David Vrabel <david.vrabel@citrix.com>
Diffstat (limited to 'drivers/xen')
-rw-r--r-- | drivers/xen/events/events_fifo.c | 6 |
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) | |||
109 | { | 109 | { |
110 | unsigned port = info->evtchn; | 110 | unsigned port = info->evtchn; |
111 | unsigned new_array_pages; | 111 | unsigned new_array_pages; |
112 | int ret = -ENOMEM; | 112 | int ret; |
113 | 113 | ||
114 | new_array_pages = port / EVENT_WORDS_PER_PAGE + 1; | 114 | new_array_pages = port / EVENT_WORDS_PER_PAGE + 1; |
115 | 115 | ||
@@ -124,8 +124,10 @@ static int evtchn_fifo_setup(struct irq_info *info) | |||
124 | array_page = event_array[event_array_pages]; | 124 | array_page = event_array[event_array_pages]; |
125 | if (!array_page) { | 125 | if (!array_page) { |
126 | array_page = (void *)__get_free_page(GFP_KERNEL); | 126 | array_page = (void *)__get_free_page(GFP_KERNEL); |
127 | if (array_page == NULL) | 127 | if (array_page == NULL) { |
128 | ret = -ENOMEM; | ||
128 | goto error; | 129 | goto error; |
130 | } | ||
129 | event_array[event_array_pages] = array_page; | 131 | event_array[event_array_pages] = array_page; |
130 | } | 132 | } |
131 | 133 | ||