summaryrefslogtreecommitdiffstats
path: root/sys/dev/ti/if_ti.c
diff options
context:
space:
mode:
authorsam <sam@FreeBSD.org>2005-03-26 23:26:49 +0000
committersam <sam@FreeBSD.org>2005-03-26 23:26:49 +0000
commit162ad543c23f6329e43376092abb7343745ea8bc (patch)
tree95a1a78972ac81653a606e16b0516360b76712fc /sys/dev/ti/if_ti.c
parent238c96d5e4adcfd0c9ba0dd40468937d5d2bb974 (diff)
downloadFreeBSD-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/dev/ti/if_ti.c')
-rw-r--r--sys/dev/ti/if_ti.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/dev/ti/if_ti.c b/sys/dev/ti/if_ti.c
index 113da99..56e2207 100644
--- a/sys/dev/ti/if_ti.c
+++ b/sys/dev/ti/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);
OpenPOWER on IntegriCloud