Fix style(9) and remove m_freem(NULL).

Add XXX comment, it looks incorrect, because m_pkthdr.len is already
incremented by M_PREPEND().

Sponsored by:	Yandex LLC
This commit is contained in:
Andrey V. Elsukov 2014-12-04 05:02:12 +00:00
parent 040bcc9ac0
commit 3d6aff5615

View File

@ -145,12 +145,11 @@ key_sendup0(struct rawcb *rp, struct mbuf *m, int promisc)
struct sadb_msg *pmsg;
M_PREPEND(m, sizeof(struct sadb_msg), M_NOWAIT);
if (!m) {
if (m == NULL) {
PFKEYSTAT_INC(in_nomem);
m_freem(m);
return ENOBUFS;
return (ENOBUFS);
}
m->m_pkthdr.len += sizeof(*pmsg);
m->m_pkthdr.len += sizeof(*pmsg); /* XXX: is this correct? */
pmsg = mtod(m, struct sadb_msg *);
bzero(pmsg, sizeof(*pmsg));