Skip to content

Commit

Permalink
fs/9p: Initialize status in v9fs_file_do_lock.
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Eric Van Hensbergen <[email protected]>
  • Loading branch information
Dominique Martinet authored and ericvh committed Mar 22, 2015
1 parent b99baa4 commit 5c4086b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/9p/vfs_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 5c4086b

Please sign in to comment.