[PATCH 2/2] 9p: avoid double put_trans on parse_opt failure

From: Dominique Martinet
Date: Tue Oct 04 2022 - 17:51:39 EST


p9_client_destroy will catch that trans and put it when p9_client_create fails

This was brought up when reviewing an alternative implementation of the
previous patch [1]

Link: https://lkml.kernel.org/r/YzVzjR4Yz3Oo3JS+@xxxxxxxxxxxxx [1]
Fixes: 3ff51294a055 ("9p: p9_client_create: use p9_client_destroy on failure")
Signed-off-by: Dominique Martinet <asmadeus@xxxxxxxxxxxxx>
---
net/9p/client.c | 2 --
1 file changed, 2 deletions(-)

diff --git a/net/9p/client.c b/net/9p/client.c
index cf2d5b60b61b..693e06213a04 100644
--- a/net/9p/client.c
+++ b/net/9p/client.c
@@ -212,8 +212,6 @@ static int parse_opts(char *opts, struct p9_client *clnt)
}

free_and_return:
- if (ret)
- v9fs_put_trans(clnt->trans_mod);
kfree(tmp_options);
return ret;
}
--
2.35.1