svn commit: r241183 - head/sys/net
Andrew Thompson
thompsa at FreeBSD.org
Thu Oct 4 07:40:56 UTC 2012
Author: thompsa
Date: Thu Oct 4 07:40:55 2012
New Revision: 241183
URL: http://svn.freebsd.org/changeset/base/241183
Log:
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
Modified:
head/sys/net/if_bridge.c
Modified: head/sys/net/if_bridge.c
==============================================================================
--- head/sys/net/if_bridge.c Thu Oct 4 06:33:03 2012 (r241182)
+++ head/sys/net/if_bridge.c Thu Oct 4 07:40:55 2012 (r241183)
@@ -270,7 +270,7 @@ static void bridge_rtflush(struct bridge
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,
*
* 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);
}
/*
More information about the svn-src-all
mailing list