Skip to content

Commit

Permalink
caif_virtio: Check that vringh_config is not null
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sjur Brændeland authored and Rusty Russell committed Mar 24, 2013
1 parent b2273be commit a8c7687
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/net/caif/caif_virtio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a8c7687

Please sign in to comment.