@@ -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;