HomeFreeBSD

mld6: Ensure that mld_domifattach() always succeeds

Description

mld6: Ensure that mld_domifattach() always succeeds

mld_domifattach() does a memory allocation under the global MLD mutex
and so can fail, but no error handling prevents a null pointer
dereference in this case. The mutex is only needed when updating the
global softc list; the allocation and static initialization of the softc
does not require this mutex. So, reduce the scope of the mutex and use
M_WAITOK for the allocation.

PR: 261457
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 5d691ab4f03d436d38f46777c3c117cf5a27f1bc)

Details

Provenance
markjAuthored on Apr 21 2022, 5:22 PM
Parents
rG3644b9209993: xhci(4): Ensure the so-called data toggle gets properly reset.
Branches
Unknown
Tags
Unknown