[PATCH] v9fs-copy-transport-proto.patch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Latchesar Ionkov <[email protected]>

Attach copy of the transport prototype to the v9fs session, not the prototype
itself. Otherwise two sessions using the same transport type will overwrite
each other's data.

---
commit 34ad50ad5bf63c55687350d9f4e3c4dcc44304a7
tree ddd9f6d0b2c00c5e8aee40d4883e1e615bea4b29
parent 4f0a459f11309161616e22f4acf918eb04a9bd1a
author Latchesar Ionkov <[email protected]> Tue, 20 Sep 2005 19:27:34 -0400
committer Latchesar Ionkov <[email protected]> Tue, 20 Sep 2005 19:27:34 -0400

 fs/9p/v9fs.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/fs/9p/v9fs.c b/fs/9p/v9fs.c
--- a/fs/9p/v9fs.c
+++ b/fs/9p/v9fs.c
@@ -303,7 +303,13 @@ v9fs_session_init(struct v9fs_session_in
 		goto SessCleanUp;
 	};
 
-	v9ses->transport = trans_proto;
+	v9ses->transport = kmalloc(sizeof(*v9ses->transport), GFP_KERNEL);
+	if (!v9ses->transport) {
+		retval = -ENOMEM;
+		goto SessCleanUp;
+	}
+
+	memmove(v9ses->transport, trans_proto, sizeof(*v9ses->transport));
 
 	if ((retval = v9ses->transport->init(v9ses, dev_name, data)) < 0) {
 		eprintk(KERN_ERR, "problem initializing transport\n");
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux