* [PATCH -next] xen/evtchn_fifo: fix error return code in evtchn_fifo_setup()
@ 2014-01-07 13:11 Wei Yongjun
2014-01-07 13:41 ` David Vrabel
2014-01-07 13:41 ` David Vrabel
0 siblings, 2 replies; 4+ messages in thread
From: Wei Yongjun @ 2014-01-07 13:11 UTC (permalink / raw)
To: konrad.wilk, boris.ostrovsky, david.vrabel
Cc: yongjun_wei, xen-devel, linux-kernel
From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
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>
---
drivers/xen/events/events_fifo.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/xen/events/events_fifo.c b/drivers/xen/events/events_fifo.c
index e2bf957..89e4893 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;
}
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH -next] xen/evtchn_fifo: fix error return code in evtchn_fifo_setup()
@ 2014-01-07 13:11 Wei Yongjun
0 siblings, 0 replies; 4+ messages in thread
From: Wei Yongjun @ 2014-01-07 13:11 UTC (permalink / raw)
To: konrad.wilk, boris.ostrovsky, david.vrabel
Cc: xen-devel, yongjun_wei, linux-kernel
From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
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>
---
drivers/xen/events/events_fifo.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/xen/events/events_fifo.c b/drivers/xen/events/events_fifo.c
index e2bf957..89e4893 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;
}
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH -next] xen/evtchn_fifo: fix error return code in evtchn_fifo_setup()
2014-01-07 13:11 [PATCH -next] xen/evtchn_fifo: fix error return code in evtchn_fifo_setup() Wei Yongjun
2014-01-07 13:41 ` David Vrabel
@ 2014-01-07 13:41 ` David Vrabel
1 sibling, 0 replies; 4+ messages in thread
From: David Vrabel @ 2014-01-07 13:41 UTC (permalink / raw)
To: Wei Yongjun
Cc: konrad.wilk, boris.ostrovsky, yongjun_wei, xen-devel,
linux-kernel
On 07/01/14 13:11, Wei Yongjun wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>
> 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.
Thanks.
Reviewed-by: David Vrabel <david.vrabel@citrix.com>
David
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH -next] xen/evtchn_fifo: fix error return code in evtchn_fifo_setup()
2014-01-07 13:11 [PATCH -next] xen/evtchn_fifo: fix error return code in evtchn_fifo_setup() Wei Yongjun
@ 2014-01-07 13:41 ` David Vrabel
2014-01-07 13:41 ` David Vrabel
1 sibling, 0 replies; 4+ messages in thread
From: David Vrabel @ 2014-01-07 13:41 UTC (permalink / raw)
To: Wei Yongjun; +Cc: xen-devel, boris.ostrovsky, yongjun_wei, linux-kernel
On 07/01/14 13:11, Wei Yongjun wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>
> 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.
Thanks.
Reviewed-by: David Vrabel <david.vrabel@citrix.com>
David
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-01-07 13:41 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-07 13:11 [PATCH -next] xen/evtchn_fifo: fix error return code in evtchn_fifo_setup() Wei Yongjun
2014-01-07 13:41 ` David Vrabel
2014-01-07 13:41 ` David Vrabel
-- strict thread matches above, loose matches on Subject: below --
2014-01-07 13:11 Wei Yongjun
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.