From: Sjur Brændeland Date: Sun, 24 Mar 2013 03:49:59 +0000 (+1030) Subject: caif_virtio: Check that vringh_config is not null X-Git-Tag: firefly_0821_release~3680^2~600^2~25 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=a8c7687bf21603af6246e55cc58f98e42241bd01;p=firefly-linux-kernel-4.4.55.git caif_virtio: Check that vringh_config is not null Check that vringh_config is not NULL before using it. Signed-off-by: Sjur Brændeland Signed-off-by: Rusty Russell --- 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;