]> git.ipfire.org Git - thirdparty/qemu.git/commit
net/af-xdp: Fix up cleanup path upon failure in queue creation
authorDaniel Borkmann <daniel@iogearbox.net>
Fri, 11 Jul 2025 09:44:15 +0000 (11:44 +0200)
committerJason Wang <jasowang@redhat.com>
Tue, 15 Jul 2025 02:26:16 +0000 (10:26 +0800)
commitbdebcb49f459237c094a5b9cb084515cfe05e1bc
tree1f6df9a5486cbe0935da35ca100d74fa31c5d5b1
parentd38c5e0d0c206dc52421b8bb777cefdf47c13b7e
net/af-xdp: Fix up cleanup path upon failure in queue creation

While testing, it turned out that upon error in the queue creation loop,
we never trigger the af_xdp_cleanup() handler. This is because we pass
errp instead of a local err pointer into the various AF_XDP setup functions
instead of a scheme like:

    bool fn(..., Error **errp)
    {
        Error *err = NULL;

        foo(arg, &err);
        if (err) {
            handle the error...
            error_propagate(errp, err);
            return false;
        }
        ...
    }

The same is true for the attachment probing with bpf_xdp_query_id(). With a
conversion into the above format, the af_xdp_cleanup() handler is called as
expected. Note the error_propagate() handles a NULL err internally.

Fixes: cb039ef3d9e3 ("net: add initial support for AF_XDP network backend")
Reviewed-by: Ilya Maximets <i.maximets@ovn.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Cc: Ilya Maximets <i.maximets@ovn.org>
Cc: Jason Wang <jasowang@redhat.com>
Cc: Anton Protopopov <aspsk@isovalent.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
net/af-xdp.c