Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a8c7687b authored by Sjur Brændeland's avatar Sjur Brændeland Committed by Rusty Russell
Browse files

caif_virtio: Check that vringh_config is not null



Check that vringh_config is not NULL before using it.

Signed-off-by: default avatarSjur Brændeland <sjur.brandeland@stericsson.com>
Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
parent b2273be8
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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;