netlink: in snl_init_writer() don't overwrite error in case of failure

PR:	290050
This commit is contained in:
Bruno Silvestre
2025-10-06 22:48:28 -07:00
committed by Gleb Smirnoff
parent a25cfcab9a
commit 488718ff42
+3 -3
View File
@@ -1068,14 +1068,14 @@ snl_init_writer(struct snl_state *ss, struct snl_writer *nw)
{ {
nw->size = SNL_WRITER_BUFFER_SIZE; nw->size = SNL_WRITER_BUFFER_SIZE;
nw->base = (char *)snl_allocz(ss, nw->size); nw->base = (char *)snl_allocz(ss, nw->size);
if (nw->base == NULL) { if (__predict_false(nw->base == NULL)) {
nw->error = true; nw->error = true;
nw->size = 0; nw->size = 0;
} } else
nw->error = false;
nw->offset = 0; nw->offset = 0;
nw->hdr = NULL; nw->hdr = NULL;
nw->error = false;
nw->ss = ss; nw->ss = ss;
} }