]> git.ipfire.org Git - thirdparty/qemu.git/commit
net/passt: Remove dead code in passt_vhost_user_start error path (CID 1612371)
authorLaurent Vivier <lvivier@redhat.com>
Thu, 17 Jul 2025 15:08:02 +0000 (17:08 +0200)
committerJason Wang <jasowang@redhat.com>
Mon, 21 Jul 2025 02:22:49 +0000 (10:22 +0800)
commitc40ef7243fdbec816242cb0ded569a61270ea7c3
tree8fc6d03572800633da3e0633dc06c37c0e992c8a
parent37c8b208cc3161c2bcd4e2ff1e1077a64872ced3
net/passt: Remove dead code in passt_vhost_user_start error path (CID 1612371)

In passt_vhost_user_start(), if vhost_net_init() fails, the "net"
variable is NULL and execution jumps to the "err:" label.

The cleanup code within this label is conditioned on "if (net)",
which can never be true in this error case. This makes the cleanup
block dead code, as reported by Coverity (CID 1612371).

Refactor the error handling to occur inline, removing the goto and
the unreachable cleanup block.

Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Jason Wang <jasowang@redhat.com>
net/passt.c