mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-23 01:10:04 +00:00
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>
This commit is contained in:
parent
b2273be8d2
commit
a8c7687bf2
1 changed files with 4 additions and 0 deletions
|
@ -670,6 +670,10 @@ static int cfv_probe(struct virtio_device *vdev)
|
||||||
spin_lock_init(&cfv->tx_lock);
|
spin_lock_init(&cfv->tx_lock);
|
||||||
|
|
||||||
/* Get the RX virtio ring. This is a "host side vring". */
|
/* 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);
|
err = vdev->vringh_config->find_vrhs(vdev, 1, &cfv->vr_rx, &vrh_cbs);
|
||||||
if (err)
|
if (err)
|
||||||
goto err;
|
goto err;
|
||||||
|
|
Loading…
Reference in a new issue