]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
netlabel: fix IPv6 unlabeled address add error handling
authorChenguang Zhao <zhaochenguang@kylinos.cn>
Fri, 22 May 2026 02:29:10 +0000 (10:29 +0800)
committerJakub Kicinski <kuba@kernel.org>
Mon, 25 May 2026 18:44:09 +0000 (11:44 -0700)
netlbl_unlhsh_add_addr6() always returned zero after
netlbl_af6list_add(), masking failures such as duplicate
IPv6 static label entries.

Signed-off-by: Chenguang Zhao <zhaochenguang@kylinos.cn>
Acked-by: Paul Moore <paul@paul-moore.com>
Link: https://patch.msgid.link/20260522022910.398416-1-zhaochenguang@kylinos.cn
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/netlabel/netlabel_unlabeled.c

index ca7a9e2a3de7813aea30924a61cb5d4433e369a7..0ab825d7f637accf1c9a034821966794c7961135 100644 (file)
@@ -295,7 +295,7 @@ static int netlbl_unlhsh_add_addr6(struct netlbl_unlhsh_iface *iface,
 
        if (ret_val != 0)
                kfree(entry);
-       return 0;
+       return ret_val;
 }
 #endif /* IPv6 */