Skip to content

Commit

Permalink
netipsec key_register: check for M_NOWAIT alloc failure
Browse files Browse the repository at this point in the history
Reviewed by:	ae, cem
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D20742
  • Loading branch information
rlibby committed Jun 25, 2019
1 parent da919cc commit 1658622
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sys/netipsec/key.c
Original file line number Diff line number Diff line change
Expand Up @@ -7164,7 +7164,7 @@ key_register(struct socket *so, struct mbuf *m, const struct sadb_msghdr *mhp)
return key_senderror(so, m, ENOBUFS);

MGETHDR(n, M_NOWAIT, MT_DATA);
if (len > MHLEN) {
if (n != NULL && len > MHLEN) {
if (!(MCLGET(n, M_NOWAIT))) {
m_freem(n);
n = NULL;
Expand Down

0 comments on commit 1658622

Please sign in to comment.