Message ID | 20231213081544.1064630-1-frolov@swemel.ru (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | hw/virtio: remove meaningless NULL-check | expand |
ping
diff --git a/hw/virtio/virtio-bus.c b/hw/virtio/virtio-bus.c index 896feb37a1..0436f545b8 100644 --- a/hw/virtio/virtio-bus.c +++ b/hw/virtio/virtio-bus.c @@ -119,10 +119,8 @@ void virtio_bus_device_unplugged(VirtIODevice *vdev) DPRINTF("%s: remove device.\n", qbus->name); - if (vdev != NULL) { - if (klass->device_unplugged != NULL) { - klass->device_unplugged(qbus->parent); - } + if (klass->device_unplugged != NULL) { + klass->device_unplugged(qbus->parent); } }
vdev is being dereferenced in the first line of the function. The following NULL-check makes no sense. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Dmitry Frolov <frolov@swemel.ru> --- hw/virtio/virtio-bus.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)