diff --git a/fs/9p/vfs_file.c b/fs/9p/vfs_file.c
index 9612e5fc0ae2416b53ac78168ab1bddd900b307d..bdb103f73e34fa0ec9ef440bc85d1984df2604fb 100644
--- a/fs/9p/vfs_file.c
+++ b/fs/9p/vfs_file.c
@@ -149,7 +149,7 @@ static int v9fs_file_do_lock(struct file *filp, int cmd, struct file_lock *fl)
 {
 	struct p9_flock flock;
 	struct p9_fid *fid;
-	uint8_t status;
+	uint8_t status = P9_LOCK_ERROR;
 	int res = 0;
 	unsigned char fl_type;