diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c
index 06b3e3f47c0ee4e714f37a5a10d0425035893586..8bbceae5ed03f3de4efaa4e3d7835415f232fd43 100644
--- a/fs/hostfs/hostfs_kern.c
+++ b/fs/hostfs/hostfs_kern.c
@@ -318,9 +318,7 @@ static int hostfs_open(struct inode *ino, struct file *file)
 	if (mode & FMODE_READ)
 		r = 1;
 	if (mode & FMODE_WRITE)
-		w = 1;
-	if (w)
-		r = 1;
+		r = w = 1;
 
 	name = dentry_name(file->f_path.dentry);
 	if (name == NULL)