mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] net/9p: return error when p9_client_stat fails
@ 2009-04-02 23:38 Latchesar Ionkov
  0 siblings, 0 replies; only message in thread
From: Latchesar Ionkov @ 2009-04-02 23:38 UTC (permalink / raw)
  To: v9fs-developer; +Cc: linux-kernel

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>
diff --git a/net/9p/client.c b/net/9p/client.c
index f5634b5..6235528 100644
--- a/net/9p/client.c
+++ b/net/9p/client.c
@@ -1208,10 +1208,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);
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-04-02 23:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-02 23:38 [PATCH] net/9p: return error when p9_client_stat fails Latchesar Ionkov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome