[Bug 276770] Some potential NULL-pointer dereferences

From: <bugzilla-noreply_at_freebsd.org>
Date: Sat, 09 Nov 2024 17:35:31 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=276770

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

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

commit f08746a7e3195a6e144e6f58003dc5c221d15d02
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2024-11-09 17:34:12 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2024-11-09 17:34:12 +0000

    nvme: Pass malloc flags to request allocation functions

    There are some contexts where it is safe to sleep, so we should pass
    M_WAITOK to ensure that a null pointer dereference can't happen.

    A few places allocate with M_NOWAIT but have no way to signal an error.
    Flag those with an XXX comment.

    PR:             276770
    Reviewed by:    imp
    MFC after:      2 weeks
    Differential Revision:  https://reviews.freebsd.org/D47307

 sys/dev/nvme/nvme_ctrlr.c     | 22 ++++++++++++++--------
 sys/dev/nvme/nvme_ctrlr_cmd.c | 29 +++++++++++++++++++----------
 sys/dev/nvme/nvme_ns_cmd.c    | 24 +++++++++---------------
 sys/dev/nvme/nvme_private.h   | 26 +++++++++++++++-----------
 sys/dev/nvme/nvme_sim.c       | 11 ++++++-----
 5 files changed, 63 insertions(+), 49 deletions(-)

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