[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] loadpolicy: only close polFd if it is valid



On Wed, Feb 10, 2016 at 04:32:39PM +0000, Ian Campbell wrote:
> It can be -1 at this point.
> 
> CID 1055562
> Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>

Acked-by: Wei Liu <wei.liu2@xxxxxxxxxx>

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

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.