Skip to content

Commit

Permalink
net/9p: set error to EREMOTEIO if trans->write returns zero
Browse files Browse the repository at this point in the history
If trans->write returns 0, p9_write_work goes through the error path, but
sets the error code to zero.

This patch sets the error code to EREMOTEIO if trans->write returns zero
value.

Signed-off-by: Latchesar Ionkov <lucho@ionkov.net>
  • Loading branch information
Latchesar Ionkov authored and Eric Van Hensbergen committed Jul 14, 2007
1 parent e46662b commit 1d6b560
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion net/9p/mux.c
Original file line number Diff line number Diff line change
Expand Up @@ -505,8 +505,12 @@ static void p9_write_work(struct work_struct *work)
return;
}

if (err <= 0)
if (err < 0)
goto error;
else if (err == 0) {
err = -EREMOTEIO;
goto error;
}

m->wpos += err;
if (m->wpos == m->wsize)
Expand Down

0 comments on commit 1d6b560

Please sign in to comment.