aboutsummaryrefslogtreecommitdiff
path: root/sys/pci
diff options
context:
space:
mode:
authorSam Leffler <sam@FreeBSD.org>2005-03-26 23:26:49 +0000
committerSam Leffler <sam@FreeBSD.org>2005-03-26 23:26:49 +0000
commit52c94c38dc876688e9870103b23cf891353738d5 (patch)
tree95a1a78972ac81653a606e16b0516360b76712fc /sys/pci
parentaf5691cdd5d80b47f0cb809c5ff57c99557e47f3 (diff)
downloadsrc-52c94c38dc876688e9870103b23cf891353738d5.tar.gz
src-52c94c38dc876688e9870103b23cf891353738d5.zip
deal with malloc failure when setting up the multicast filter
Noticed by: Coverity Prevent analysis tool
Notes
Notes: svn path=/head/; revision=144165
Diffstat (limited to 'sys/pci')
-rw-r--r--sys/pci/if_ti.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/pci/if_ti.c b/sys/pci/if_ti.c
index 113da99057cd..56e2207e6cdc 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);