xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86: fix improper return value from relinquish_memory()
@ 2010-03-24 11:07 Jan Beulich
  2010-03-24 11:23 ` Jan Beulich
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Beulich @ 2010-03-24 11:07 UTC (permalink / raw)
  To: xen-devel

[-- Attachment #1: Type: text/plain, Size: 761 bytes --]

While apparently only a theoretical possibility (domain_kill() has a
BUG_ON() that wasn't reported to trigger so far), I still think it is
better to have the code cleaned up.

Signed-off-by: Jan Beulich <jbeulich@novell.com>

--- 2010-03-22.orig/xen/arch/x86/domain.c	2010-03-22 00:00:00.000000000 +0100
+++ 2010-03-22/xen/arch/x86/domain.c	2010-03-24 11:57:49.000000000 +0100
@@ -1821,8 +1821,10 @@ static int relinquish_memory(
         {
         case 0:
             break;
-        case -EAGAIN:
         case -EINTR:
+            ret = -EAGAIN;
+            /* fallthrough */
+        case -EAGAIN:
             page_list_add(page, list);
             set_bit(_PGT_pinned, &page->u.inuse.type_info);
             put_page(page);




[-- Attachment #2: x86-domain-cleanup-EINTR.patch --]
[-- Type: text/plain, Size: 755 bytes --]

While apparently only a theoretical possibility (domain_kill() has a
BUG_ON() that wasn't reported to trigger so far), I still think it is
better to have the code cleaned up.

Signed-off-by: Jan Beulich <jbeulich@novell.com>

--- 2010-03-22.orig/xen/arch/x86/domain.c	2010-03-22 00:00:00.000000000 +0100
+++ 2010-03-22/xen/arch/x86/domain.c	2010-03-24 11:57:49.000000000 +0100
@@ -1821,8 +1821,10 @@ static int relinquish_memory(
         {
         case 0:
             break;
-        case -EAGAIN:
         case -EINTR:
+            ret = -EAGAIN;
+            /* fallthrough */
+        case -EAGAIN:
             page_list_add(page, list);
             set_bit(_PGT_pinned, &page->u.inuse.type_info);
             put_page(page);

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-03-24 14:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-24 11:07 [PATCH] x86: fix improper return value from relinquish_memory() Jan Beulich
2010-03-24 11:23 ` Jan Beulich
2010-03-24 14:43   ` Konrad Rzeszutek Wilk
2010-03-24 14:54     ` Keir Fraser

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).