mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-29 16:44:03 +00:00
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
This commit is contained in:
parent
50936af6e1
commit
3e92ee8a53
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=241183
@ -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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user