Bug 258420

Summary: stge: fix null pointer dereference
Product: Base System Reporter: Tong Zhang <ztong0001>
Component: kernAssignee: freebsd-net (Nobody) <net>
Status: New ---    
Severity: Affects Only Me    
Priority: ---    
Version: CURRENT   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
patch none

Description Tong Zhang 2021-09-11 07:20:21 UTC
Created attachment 227824 [details]
patch

stge_attach() could fail at line 464, sc->sc_spec remains NULL when
calling stge_detach(), thus bus_release_resources() at line 704 will
trigger null pointer dereference. We need to check the nulliness before
calling bus_release_resources().