aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLatchesar Ionkov <lucho@ionkov.net>2009-04-05 17:26:41 -0400
committerEric Van Hensbergen <ericvh@vTrogdor.(none)>2009-04-05 17:54:52 -0400
commit742b11a7ec60faa25d76c95c268041ab215c25ad (patch)
tree86305d4b295f859d89fedd27a5f54ad8b029e5c3
parent453ed90d1395a5281a8f1a0de5d8aabc66202e34 (diff)
net/9p: return error when p9_client_stat fails
p9_client_stat function doesn't return correct value if it fails. p9_client_stat should return ERR_PTR of the error value when it fails. Instead, it always returns a value to the allocated p9_wstat struct even when it is not populated correctly. This patch makes p9_client_stat to handle failure correctly. Signed-off-by: Latchesar Ionkov <lucho@ionkov.net> Reviewed-by: Eric Van Hensbergen <ericvh@gmail.com>
-rw-r--r--net/9p/client.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/net/9p/client.c b/net/9p/client.c
index 93f442aaa119..781d89a952e4 100644
--- a/net/9p/client.c
+++ b/net/9p/client.c
@@ -1244,10 +1244,14 @@ struct p9_wstat *p9_client_stat(struct p9_fid *fid)
1244 ret->name, ret->uid, ret->gid, ret->muid, ret->extension, 1244 ret->name, ret->uid, ret->gid, ret->muid, ret->extension,
1245 ret->n_uid, ret->n_gid, ret->n_muid); 1245 ret->n_uid, ret->n_gid, ret->n_muid);
1246 1246
1247 p9_free_req(clnt, req);
1248 return ret;
1249
1247free_and_error: 1250free_and_error:
1248 p9_free_req(clnt, req); 1251 p9_free_req(clnt, req);
1249error: 1252error:
1250 return ret; 1253 kfree(ret);
1254 return ERR_PTR(err);
1251} 1255}
1252EXPORT_SYMBOL(p9_client_stat); 1256EXPORT_SYMBOL(p9_client_stat);
1253 1257