linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fs/9p: Initialize status in v9fs_file_do_lock.
@ 2015-01-09 11:56 Dominique Martinet
  2015-01-09 12:33 ` Kirill A. Shutemov
  0 siblings, 1 reply; 5+ messages in thread
From: Dominique Martinet @ 2015-01-09 11:56 UTC (permalink / raw)
  To: Eric Van Hensbergen, Ron Minnich, Latchesar Ionkov
  Cc: v9fs-developer, linux-fsdevel, linux-kernel, Dominique Martinet

If p9_client_lock_dotl returns an error, status is possibly never filled
but will be used in the following switch.
Initializing it to P9_LOCK_ERROR makes sur we will return an error and
cleanup (and not hit the default case).

Signed-off-by: Dominique Martinet <dominique.martinet@cea.fr>
---
 fs/9p/vfs_file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/9p/vfs_file.c b/fs/9p/vfs_file.c
index 5594505..9b02849 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;
 
-- 
1.9.3

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-01-09 13:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-09 11:56 [PATCH] fs/9p: Initialize status in v9fs_file_do_lock Dominique Martinet
2015-01-09 12:33 ` Kirill A. Shutemov
2015-01-09 13:07   ` Dominique Martinet
2015-01-09 13:20     ` Kirill A. Shutemov
2015-01-09 13:29       ` Dominique Martinet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).