mirror of
https://github.com/opnsense/src.git
synced 2026-06-08 16:22:46 -04:00
netlink: snl_create_msg_request() may fail due to ENOMEM
This commit is contained in:
parent
c1f6b799a7
commit
c3df2fa9a7
1 changed files with 5 additions and 1 deletions
|
|
@ -1261,9 +1261,13 @@ snl_end_attr_nested(const struct snl_writer *nw, int off)
|
|||
static inline struct nlmsghdr *
|
||||
snl_create_msg_request(struct snl_writer *nw, int nlmsg_type)
|
||||
{
|
||||
struct nlmsghdr *hdr;
|
||||
|
||||
assert(nw->hdr == NULL);
|
||||
|
||||
struct nlmsghdr *hdr = snl_reserve_msg_object(nw, struct nlmsghdr);
|
||||
if (__predict_false((hdr =
|
||||
snl_reserve_msg_object(nw, struct nlmsghdr)) == NULL))
|
||||
return (NULL);
|
||||
hdr->nlmsg_type = nlmsg_type;
|
||||
hdr->nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK;
|
||||
nw->hdr = hdr;
|
||||
|
|
|
|||
Loading…
Reference in a new issue