Re: [PATCH -mm 5/8] user ns: prepare copy_tree, copy_mnt, and their callers to handle errs

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

 



On Thu, Jan 04, 2007 at 12:12:15PM -0600, Serge E. Hallyn wrote:
> diff --git a/fs/namespace.c b/fs/namespace.c
> index 5da87e2..a4039a3 100644
> --- a/fs/namespace.c
> +++ b/fs/namespace.c
> @@ -708,8 +708,9 @@ struct vfsmount *copy_tree(struct vfsmou
>  		return NULL;
>  
>  	res = q = clone_mnt(mnt, dentry, flag);
> -	if (!q)
> -		goto Enomem;
> +	if (!q || IS_ERR(q)) {
> +		return q;
> +	}
>  	q->mnt_mountpoint = mnt->mnt_mountpoint;
>  
>  	p = mnt;
> @@ -730,8 +731,9 @@ struct vfsmount *copy_tree(struct vfsmou
>  			nd.mnt = q;
>  			nd.dentry = p->mnt_mountpoint;
>  			q = clone_mnt(p, p->mnt_root, flag);
> -			if (!q)
> -				goto Enomem;
> +			if (!q || IS_ERR(q)) {
> +				goto Error;
> +			}
>  			spin_lock(&vfsmount_lock);
>  			list_add_tail(&q->mnt_list, &res->mnt_list);
>  			attach_mnt(q, &nd);
> @@ -739,7 +741,7 @@ struct vfsmount *copy_tree(struct vfsmou
>  		}
>  	}
>  	return res;
> -Enomem:
> +Error:
>  	if (res) {
        ^^^^^^^^^^
I think that this check can be safely skiped, as res is always non-NULL
when Error: is now reached, isn't it?

Regards,
Frederik
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux