diff options
author | Sjur Brændeland <sjur.brandeland@stericsson.com> | 2013-03-23 23:49:59 -0400 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2013-03-23 23:59:15 -0400 |
commit | a8c7687bf21603af6246e55cc58f98e42241bd01 (patch) | |
tree | 5dad9b5fffcf702947f6c1b83b2b4e28c8bd970e /drivers/net/caif | |
parent | b2273be8d2df7b77165a70930064aeb9e8faebfa (diff) |
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 <sjur.brandeland@stericsson.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'drivers/net/caif')
-rw-r--r-- | drivers/net/caif/caif_virtio.c | 4 |
1 files changed, 4 insertions, 0 deletions
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) | |||
670 | spin_lock_init(&cfv->tx_lock); | 670 | spin_lock_init(&cfv->tx_lock); |
671 | 671 | ||
672 | /* Get the RX virtio ring. This is a "host side vring". */ | 672 | /* Get the RX virtio ring. This is a "host side vring". */ |
673 | err = -ENODEV; | ||
674 | if (!vdev->vringh_config || !vdev->vringh_config->find_vrhs) | ||
675 | goto err; | ||
676 | |||
673 | err = vdev->vringh_config->find_vrhs(vdev, 1, &cfv->vr_rx, &vrh_cbs); | 677 | err = vdev->vringh_config->find_vrhs(vdev, 1, &cfv->vr_rx, &vrh_cbs); |
674 | if (err) | 678 | if (err) |
675 | goto err; | 679 | goto err; |