[CRIU] [PATCH 6/9] sysctl_op(): fix check for known ns mask

Andrew Vagin avagin at odin.com
Wed Oct 7 04:26:06 PDT 2015


On Wed, Oct 07, 2015 at 02:44:21AM -0700, Kir Kolyshkin wrote:
> This must be boolean not logical NOT.
> 
> Reported by Coverity, CID 114612.
> 
> Signed-off-by: Kir Kolyshkin <kir at openvz.org>
> ---
>  sysctl.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/sysctl.c b/sysctl.c
> index 1e7ee66..0290795 100644
> --- a/sysctl.c
> +++ b/sysctl.c
> @@ -387,7 +387,7 @@ int sysctl_op(struct sysctl_req *req, size_t nr_req, int op, unsigned int ns)
>  	if (nr_req == 0)
>  		return 0;
>  
> -	if (ns & !KNOWN_NS_MASK) {
> +	if (ns & ~KNOWN_NS_MASK) {

https://lists.openvz.org/pipermail/criu/2015-October/022434.html
>  		pr_err("don't know how to restore some namespaces in %u\n", ns);
>  		return -1;
>  	}
> -- 
> 2.4.3
> 
> _______________________________________________
> CRIU mailing list
> CRIU at openvz.org
> https://lists.openvz.org/mailman/listinfo/criu


More information about the CRIU mailing list