summaryrefslogtreecommitdiffstats
path: root/sys/net/if_bridge.c
diff options
context:
space:
mode:
authorthompsa <thompsa@FreeBSD.org>2012-10-04 07:40:55 +0000
committerthompsa <thompsa@FreeBSD.org>2012-10-04 07:40:55 +0000
commit7b87b7c7117f293cd849a872696fdfa161ce22d9 (patch)
tree8559454b4d9c203227af31317b1e5b1028b47113 /sys/net/if_bridge.c
parent5f60658e7f75d012ddf621512623fae38a06771e (diff)
downloadFreeBSD-src-7b87b7c7117f293cd849a872696fdfa161ce22d9.zip
FreeBSD-src-7b87b7c7117f293cd849a872696fdfa161ce22d9.tar.gz
Remove the M_NOWAIT from bridge_rtable_init as it isn't needed. The function
return value is not even checked and could lead to a panic on a null sc_rthash. MFC after: 2 weeks
Diffstat (limited to 'sys/net/if_bridge.c')
-rw-r--r--sys/net/if_bridge.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c
index ad7befa..86f4525 100644
--- a/sys/net/if_bridge.c
+++ b/sys/net/if_bridge.c
@@ -270,7 +270,7 @@ static void bridge_rtflush(struct bridge_softc *, int);
static int bridge_rtdaddr(struct bridge_softc *, const uint8_t *,
uint16_t);
-static int bridge_rtable_init(struct bridge_softc *);
+static void bridge_rtable_init(struct bridge_softc *);
static void bridge_rtable_fini(struct bridge_softc *);
static int bridge_rtnode_addr_cmp(const uint8_t *, const uint8_t *);
@@ -2736,24 +2736,19 @@ bridge_rtdelete(struct bridge_softc *sc, struct ifnet *ifp, int full)
*
* Initialize the route table for this bridge.
*/
-static int
+static void
bridge_rtable_init(struct bridge_softc *sc)
{
int i;
sc->sc_rthash = malloc(sizeof(*sc->sc_rthash) * BRIDGE_RTHASH_SIZE,
- M_DEVBUF, M_NOWAIT);
- if (sc->sc_rthash == NULL)
- return (ENOMEM);
+ M_DEVBUF, M_WAITOK);
for (i = 0; i < BRIDGE_RTHASH_SIZE; i++)
LIST_INIT(&sc->sc_rthash[i]);
sc->sc_rthash_key = arc4random();
-
LIST_INIT(&sc->sc_rtlist);
-
- return (0);
}
/*
OpenPOWER on IntegriCloud