[PATCH 4/8] fs/9p: One function call less in v9fs_fid_xattr_get() after error detection

SF Markus Elfring
2014-12-28T20:44:59Z

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sun, 28 Dec 2014 09:05:25 +0100

The p9_client_clunk() function was called in one case by the
v9fs_fid_xattr_get() function during error handling even if the passed
variable "attr_fid" contained a null pointer.

Let us delete an unnecessary variable assignment there and return from
this implementation directly after a failure detection for
a p9_client_xattrwalk() call.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
fs/9p/xattr.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/9p/xattr.c b/fs/9p/xattr.c
index 8e72269..05ef790 100644
--- a/fs/9p/xattr.c
+++ b/fs/9p/xattr.c
@@ -34,8 +34,7 @@ ssize_t v9fs_fid_xattr_get(struct p9_fid *fid, const char *name,
retval = PTR_ERR(attr_fid);
p9_debug(P9_DEBUG_VFS, "p9_client_attrwalk failed %zd\n",
retval);
- attr_fid = NULL;
- goto error;
+ return retval;
}
if (!buffer_size) {
/* request to get the attr_size */
--
2.2.1