[patch 2/2] r/o bind mounts: Accept passing a mnt NULL pointer to mnt_drop_write()

From: Jan Blunck
Date: Fri Oct 12 2007 - 12:02:29 EST


In case of somebody opens a file with dentry_open(dentry, NULL, ...) we don't
want to stumble on the NULL pointer mnt in struct file.

Signed-off-by: Jan Blunck <jblunck@xxxxxxx>
---
fs/namespace.c | 3 +++
1 file changed, 3 insertions(+)

Index: b/fs/namespace.c
===================================================================
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -253,6 +253,9 @@ void mnt_drop_write(struct vfsmount *mnt
int must_check_underflow = 0;
struct mnt_writer *cpu_writer;

+ if (!mnt)
+ return;
+
cpu_writer = &get_cpu_var(mnt_writers);
spin_lock(&cpu_writer->lock);


--

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/