Skip to content

Commit

Permalink
9p: Possible regression in p9_client_stat
Browse files Browse the repository at this point in the history
Fix a possible regression with p9_client_stat where it can try to kfree 
an ERR_PTR after an erroneous p9pdu_readf. Also remove an unnecessary data 
buffer increment in p9_client_read.

Signed-off-by: Abhishek Kulkarni <adkulkar@umail.iu.edu>
Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
  • Loading branch information
Abhishek Kulkarni authored and Eric Van Hensbergen committed Jul 14, 2009
1 parent a17d172 commit eedfe1c
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions net/9p/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -1098,7 +1098,6 @@ p9_client_read(struct p9_fid *fid, char *data, char __user *udata, u64 offset,

if (data) {
memmove(data, dataptr, count);
data += count;
}

if (udata) {
Expand Down Expand Up @@ -1192,9 +1191,9 @@ struct p9_wstat *p9_client_stat(struct p9_fid *fid)

err = p9pdu_readf(req->rc, clnt->dotu, "wS", &ignored, ret);
if (err) {
ret = ERR_PTR(err);
p9pdu_dump(1, req->rc);
goto free_and_error;
p9_free_req(clnt, req);
goto error;
}

P9_DPRINTK(P9_DEBUG_9P,
Expand All @@ -1211,8 +1210,6 @@ struct p9_wstat *p9_client_stat(struct p9_fid *fid)
p9_free_req(clnt, req);
return ret;

free_and_error:
p9_free_req(clnt, req);
error:
kfree(ret);
return ERR_PTR(err);
Expand Down

0 comments on commit eedfe1c

Please sign in to comment.