From a8c7687bf21603af6246e55cc58f98e42241bd01 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sjur=20Br=C3=A6ndeland?= Date: Sun, 24 Mar 2013 14:19:59 +1030 Subject: [PATCH] caif_virtio: Check that vringh_config is not null MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Check that vringh_config is not NULL before using it. Signed-off-by: Sjur Brændeland Signed-off-by: Rusty Russell --- drivers/net/caif/caif_virtio.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/caif/caif_virtio.c b/drivers/net/caif/caif_virtio.c index fb80765e258e..316b184ea130 100644 --- a/drivers/net/caif/caif_virtio.c +++ b/drivers/net/caif/caif_virtio.c @@ -670,6 +670,10 @@ static int cfv_probe(struct virtio_device *vdev) spin_lock_init(&cfv->tx_lock); /* Get the RX virtio ring. This is a "host side vring". */ + err = -ENODEV; + if (!vdev->vringh_config || !vdev->vringh_config->find_vrhs) + goto err; + err = vdev->vringh_config->find_vrhs(vdev, 1, &cfv->vr_rx, &vrh_cbs); if (err) goto err; -- 2.39.5