hw/net: Fix NULL dereference with software RSS
authorAkihiko Odaki <akihiko.odaki@daynix.com>
Thu, 16 Jan 2025 07:30:43 +0000 (16:30 +0900)
committerMichael S. Tsirkin <mst@redhat.com>
Thu, 20 Feb 2025 23:23:19 +0000 (18:23 -0500)
commitbc82af6b0dcb0933e72640851fdd2594f822b23e
treef5873d81d3599c25d43ec9eade05e048839d1826
parent6f9a1a01433738811c9795dcf29f299c60835558
hw/net: Fix NULL dereference with software RSS

When an eBPF program cannot be attached, virtio_net_load_ebpf() returns
false, and virtio_net_device_realize() enters the code path to handle
errors because of this, but it causes NULL dereference because no error
is generated.

Change virtio_net_load_ebpf() to return false only when a fatal error
occurred.

Fixes: b5900dff14e5 ("hw/net: report errors from failing to use eBPF RSS FDs")
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Message-Id: <20250116-software-v1-1-9e5161b534d8@daynix.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/net/virtio-net.c