diff mbox

[V9fs-developer,RFC] 9P/Virtio: kernel panic in 'mount' command.

Message ID 20100201223707.1dda3532@in.ibm.com (mailing list archive)
State Superseded, archived
Delegated to: Eric Van Hensbergen
Headers show

Commit Message

Sripathi Kodi Feb. 1, 2010, 5:07 p.m. UTC
None
diff mbox

Patch

diff -uprN a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c
--- a/net/9p/trans_virtio.c	2010-02-01 21:21:34.000000000 +0530
+++ b/net/9p/trans_virtio.c	2010-02-01 22:24:25.000000000 +0530
@@ -101,9 +101,11 @@  static void p9_virtio_close(struct p9_cl
 {
 	struct virtio_chan *chan = client->trans;
 
-	mutex_lock(&virtio_9p_lock);
-	chan->inuse = false;
-	mutex_unlock(&virtio_9p_lock);
+	if (chan) {
+		mutex_lock(&virtio_9p_lock);
+		chan->inuse = false;
+		mutex_unlock(&virtio_9p_lock);
+	}
 }
 
 /**
@@ -307,7 +309,7 @@  p9_virtio_create(struct p9_client *clien
 
 	if (index >= MAX_9P_CHAN) {
 		printk(KERN_ERR "9p: no channels available\n");
-		return -ENODEV;
+		return -EBUSY;
 	}
 
 	client->trans = (void *)chan;