xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] loadpolicy: only close polFd if it is valid
@ 2016-02-10 16:32 Ian Campbell
  2016-02-11 11:20 ` Wei Liu
  0 siblings, 1 reply; 4+ messages in thread
From: Ian Campbell @ 2016-02-10 16:32 UTC (permalink / raw)
  To: Daniel De Graaf, ian.jackson, wei.liu2, xen-devel; +Cc: Ian Campbell

It can be -1 at this point.

CID 1055562
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/flask/utils/loadpolicy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/flask/utils/loadpolicy.c b/tools/flask/utils/loadpolicy.c
index 47b5139..76710a2 100644
--- a/tools/flask/utils/loadpolicy.c
+++ b/tools/flask/utils/loadpolicy.c
@@ -115,7 +115,7 @@ done:
         if ( ret < 0 )
             fprintf(stderr, "Unable to unmap policy memory: %s\n", strerror(errno));
     }
-    if ( polFd )
+    if ( polFd >= 0 )
         close(polFd);
     if ( xch )
         xc_interface_close(xch);
-- 
2.1.4

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

end of thread, other threads:[~2016-02-29 15:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-10 16:32 [PATCH] loadpolicy: only close polFd if it is valid Ian Campbell
2016-02-11 11:20 ` Wei Liu
2016-02-23 10:30   ` Ian Campbell
2016-02-29 15:49     ` Konrad Rzeszutek Wilk

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).