Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 Mar 2025 17:02:41 GMT
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: f402078d0956 - main - device_pager: Assert that the handle is not NULL
Message-ID:  <202503131702.52DH2f1i063221@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by jhb:

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

commit f402078d0956cfd6f6afcf998271e058c478e34a
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2025-03-13 16:57:40 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2025-03-13 16:57:40 +0000

    device_pager: Assert that the handle is not NULL
    
    Reviewed by:    kib
    Differential Revision:  https://reviews.freebsd.org/D49333
---
 sys/vm/device_pager.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sys/vm/device_pager.c b/sys/vm/device_pager.c
index 0b3a2eb54d75..15626938ba95 100644
--- a/sys/vm/device_pager.c
+++ b/sys/vm/device_pager.c
@@ -138,6 +138,8 @@ cdev_pager_allocate(void *handle, enum obj_type tp,
 	vm_object_t object;
 	vm_pindex_t pindex;
 
+	KASSERT(handle != NULL, ("device pager with NULL handle"));
+
 	if (tp != OBJT_DEVICE && tp != OBJT_MGTDEVICE)
 		return (NULL);
 	KASSERT(tp == OBJT_MGTDEVICE || ops->cdev_pg_populate == NULL,



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202503131702.52DH2f1i063221>