[Bug 258420] stge: fix null pointer dereference

From: <bugzilla-noreply_at_freebsd.org>
Date: Thu, 31 Mar 2022 20:00:36 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=258420

--- Comment #2 from commit-hook@FreeBSD.org ---
A commit in branch main references this bug:

URL:
https://cgit.FreeBSD.org/src/commit/?id=2108cc72906f274f30306570268434c4f8d23636

commit 2108cc72906f274f30306570268434c4f8d23636
Author:     Tong Zhang <ztong0001@gmail.com>
AuthorDate: 2022-03-31 18:16:55 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2022-03-31 19:54:56 +0000

    stge: fix null pointer dereference

    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().

    PR:             258420
    Reviewed by:    markj
    MFC after:      1 week
    Differential Revision:  https://reviews.freebsd.org/D34629

 sys/dev/stge/if_stge.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

-- 
You are receiving this mail because:
You are the assignee for the bug.