The branch stable/14 has been updated by glebius:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=cf95eabb5572368c80d72c151ebebca8cf6b2dbc

commit cf95eabb5572368c80d72c151ebebca8cf6b2dbc
Author:     Bruno Silvestre <[email protected]>
AuthorDate: 2025-10-07 05:48:28 +0000
Commit:     Gleb Smirnoff <[email protected]>
CommitDate: 2025-11-21 16:52:01 +0000

    netlink: in snl_init_writer() don't overwrite error in case of failure
    
    PR:     290050
    (cherry picked from commit 488718ff42346888243496c00cbeb42ba004171e)
---
 sys/netlink/netlink_snl.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sys/netlink/netlink_snl.h b/sys/netlink/netlink_snl.h
index 03f2b7dc5c38..1a33a814c611 100644
--- a/sys/netlink/netlink_snl.h
+++ b/sys/netlink/netlink_snl.h
@@ -1025,14 +1025,14 @@ snl_init_writer(struct snl_state *ss, struct snl_writer 
*nw)
 {
        nw->size = SNL_WRITER_BUFFER_SIZE;
        nw->base = (char *)snl_allocz(ss, nw->size);
-       if (nw->base == NULL) {
+       if (__predict_false(nw->base == NULL)) {
                nw->error = true;
                nw->size = 0;
-       }
+       } else
+               nw->error = false;
 
        nw->offset = 0;
        nw->hdr = NULL;
-       nw->error = false;
        nw->ss = ss;
 }
 

Reply via email to