提交 742b11a7 编写于 作者: L Latchesar Ionkov 提交者: Eric Van Hensbergen

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: NLatchesar Ionkov <lucho@ionkov.net>
Reviewed-by: NEric Van Hensbergen <ericvh@gmail.com>
上级 453ed90d
......@@ -1244,10 +1244,14 @@ struct p9_wstat *p9_client_stat(struct p9_fid *fid)
ret->name, ret->uid, ret->gid, ret->muid, ret->extension,
ret->n_uid, ret->n_gid, ret->n_muid);
p9_free_req(clnt, req);
return ret;
free_and_error:
p9_free_req(clnt, req);
error:
return ret;
kfree(ret);
return ERR_PTR(err);
}
EXPORT_SYMBOL(p9_client_stat);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册