Simplify epair_clone_create() and epair_clone_destroy() by factoring out epair_softc allocation / desctruction and ifp setup/teardown into separate functions.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
sys/net/if_epair.c | ||
---|---|---|
495 | I think epair_alloc_sc() will prevent potential naming pollution. | |
667 | if (sca == NULL ^ scb == NULL), then free_sc(sca) or free_sc(scb) may trigger null pointer dereference. |
sys/net/if_epair.c | ||
---|---|---|
667 | Good catch! A simple if (sc == NULL) return; in free_sc() should work, and matches the regular free() idiom. |
sys/net/if_epair.c | ||
---|---|---|
667 | Yep, that's a good one! |