mnt: Fix the error check in __detach_mounts
authorEric W. Biederman <ebiederm@xmission.com>
Mon, 19 Jan 2015 17:48:45 +0000 (11:48 -0600)
committerEric W. Biederman <ebiederm@xmission.com>
Thu, 9 Apr 2015 16:39:56 +0000 (11:39 -0500)
commitf53e57975151f54ad8caa1b0ac8a78091cd5700a
tree7322a985d8f37d229cdb6ef66ddae5bf218b9df6
parentce07d891a0891d3c0d0c2d73d577490486b809e1
mnt: Fix the error check in __detach_mounts

lookup_mountpoint can return either NULL or an error value.
Update the test in __detach_mounts to test for an error value
to avoid pathological cases causing a NULL pointer dereferences.

The callers of __detach_mounts should prevent it from ever being
called on an unlinked dentry but don't take any chances.

Cc: stable@vger.kernel.org
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
fs/namespace.c