Skip to content

vhost: NULL callback checks

Kevin Traynor dpdk-dev 1 version Applied

Status from this message: Applied to next-virtio/for-next-net.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest1 patch 2 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/1vhost: add NULL callback checkslib/vhost/vduse.c lib/vhost/vhost.c lib/vhost/vhost_user.c+7 -42 replies

Reviews trailers per patch

The patch has a Reviewed-by or Acked-by.

PatchMaxime Coquelin
1/1R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/1] vhost: NULL callback checks

Not a normal case, but noticed that setting some callbacks to NULL in rte_vhost_driver_callback_register() causes a seg fault e.g. [0].

Added missing checks before calling. Alternative fix is to make some callbacks mandatory and check during register - is that an API change? maybe, so took simpler approach.

A bit hard to find fixed commit due to the time and amount of development in vhost code.

[0]

3302│         if (!(dev->flags & VIRTIO_DEV_RUNNING)) {
3303├>                if (dev->notify_ops->new_device(dev->vid) == 0)
3304│                         dev->flags |= VIRTIO_DEV_RUNNING;
3305│         }

(gdb) frame 1
at ../lib/vhost/vhost_user.c:3303
(gdb) p dev->notify_ops->new_device
$3 = (int (*)(int)) 0x0

Kevin Traynor (1):
vhost: add NULL callback checks

 lib/vhost/vduse.c      | 3 ++-
 lib/vhost/vhost.c      | 5 +++--
 lib/vhost/vhost_user.c | 3 ++-
 3 files changed, 7 insertions(+), 4 deletions(-)
Signature · 1 line
2.48.1