diff options
author | sam <sam@FreeBSD.org> | 2005-03-26 23:26:49 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2005-03-26 23:26:49 +0000 |
commit | 162ad543c23f6329e43376092abb7343745ea8bc (patch) | |
tree | 95a1a78972ac81653a606e16b0516360b76712fc /sys/pci | |
parent | 238c96d5e4adcfd0c9ba0dd40468937d5d2bb974 (diff) | |
download | FreeBSD-src-162ad543c23f6329e43376092abb7343745ea8bc.zip FreeBSD-src-162ad543c23f6329e43376092abb7343745ea8bc.tar.gz |
deal with malloc failure when setting up the multicast filter
Noticed by: Coverity Prevent analysis tool
Diffstat (limited to 'sys/pci')
-rw-r--r-- | sys/pci/if_ti.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/pci/if_ti.c b/sys/pci/if_ti.c index 113da99..56e2207 100644 --- a/sys/pci/if_ti.c +++ b/sys/pci/if_ti.c @@ -1626,6 +1626,10 @@ ti_setmulti(sc) if (ifma->ifma_addr->sa_family != AF_LINK) continue; mc = malloc(sizeof(struct ti_mc_entry), M_DEVBUF, M_NOWAIT); + if (mc == NULL) { + if_printf(ifp, "no memory for mcast filter entry\n"); + continue; + } bcopy(LLADDR((struct sockaddr_dl *)ifma->ifma_addr), (char *)&mc->mc_addr, ETHER_ADDR_LEN); SLIST_INSERT_HEAD(&sc->ti_mc_listhead, mc, mc_entries); |