Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[firefly-linux-kernel-4.4.55.git] / net / 9p / trans_virtio.c
index daa749c8b3fbea2cc319ceb6a1ce4a9c20d9eece..d8e376a5f0f13d9eed735f62b81367b7bc685ebe 100644 (file)
@@ -524,6 +524,12 @@ static int p9_virtio_probe(struct virtio_device *vdev)
        int err;
        struct virtio_chan *chan;
 
+       if (!vdev->config->get) {
+               dev_err(&vdev->dev, "%s failure: config access disabled\n",
+                       __func__);
+               return -EINVAL;
+       }
+
        chan = kmalloc(sizeof(struct virtio_chan), GFP_KERNEL);
        if (!chan) {
                pr_err("Failed to allocate virtio 9P channel\n");