[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen master] lowmemd: fix comparison in cleanup
commit 2f5af2c962c05b789bdd65b46c74711e903f86d0 Author: Norbert Manthey <nmanthey@xxxxxxxxxx> AuthorDate: Fri Feb 17 11:47:46 2017 +0100 Commit: Wei Liu <wei.liu2@xxxxxxxxxx> CommitDate: Mon Feb 20 16:55:24 2017 +0000 lowmemd: fix comparison in cleanup The variable virq_port of type uint32_t was compared to being greater than -1. This check always results in false for unsigned data types, resulting in never cleaning up the memory. Furthermore, the initialization with a negative variable for an unsigned type has been fixed. Signed-off-by: Norbert Manthey <nmanthey@xxxxxxxxxx> Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx> Acked-by: Wei Liu <wei.liu2@xxxxxxxxxx> --- tools/misc/xen-lowmemd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/misc/xen-lowmemd.c b/tools/misc/xen-lowmemd.c index 3200404..865a54c 100644 --- a/tools/misc/xen-lowmemd.c +++ b/tools/misc/xen-lowmemd.c @@ -10,14 +10,14 @@ #include <stdlib.h> #include <string.h> -static evtchn_port_t virq_port = -1; +static evtchn_port_t virq_port = ~0; static xenevtchn_handle *xce_handle = NULL; static xc_interface *xch = NULL; static struct xs_handle *xs_handle = NULL; void cleanup(void) { - if (virq_port > -1) + if (virq_port != ~0) xenevtchn_unbind(xce_handle, virq_port); if (xce_handle) xenevtchn_close(xce_handle); -- generated by git-patchbot for /home/xen/git/xen.git#master _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxx https://lists.xenproject.org/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |