Skip to content

Commit a466fd7

Browse files
Vitaliy Shevtsovkuba-moo
authored andcommitted
caif_virtio: fix wrong pointer check in cfv_probe()
del_vqs() frees virtqueues, therefore cfv->vq_tx pointer should be checked for NULL before calling it, not cfv->vdev. Also the current implementation is redundant because the pointer cfv->vdev is dereferenced before it is checked for NULL. Fix this by checking cfv->vq_tx for NULL instead of cfv->vdev before calling del_vqs(). Fixes: 0d2e1a2 ("caif_virtio: Introduce caif over virtio") Signed-off-by: Vitaliy Shevtsov <[email protected]> Reviewed-by: Gerhard Engleder <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent ee01b2f commit a466fd7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/caif/caif_virtio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,7 @@ static int cfv_probe(struct virtio_device *vdev)
745745

746746
if (cfv->vr_rx)
747747
vdev->vringh_config->del_vrhs(cfv->vdev);
748-
if (cfv->vdev)
748+
if (cfv->vq_tx)
749749
vdev->config->del_vqs(cfv->vdev);
750750
free_netdev(netdev);
751751
return err;

0 commit comments

Comments
 (0)