From d38d8a4c4e9a3c4667307ac2163007ff193040b0 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Fri, 13 Jan 2023 14:19:39 -0700 Subject: [PATCH] stand/ofw: dev can't be NULL here dev can't be NULL here. ofw_common_parsedev is always called via devparse (indirectly through dv_parsedev() calls there which call it with the args unchanged). In the past, ofw_getdev could call us with NULL pointer for the parse-only case, but that's now all handled inside of devparse for simplicity. Sponsored by: Netflix Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D38041 --- stand/libofw/devicename.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/stand/libofw/devicename.c b/stand/libofw/devicename.c index 76ba5530520c..510fe9d92ec1 100644 --- a/stand/libofw/devicename.c +++ b/stand/libofw/devicename.c @@ -108,8 +108,7 @@ ofw_common_parsedev(struct devdesc **dev, const char *devspec, const char **path }; strlcpy(idev->d_path, devspec, min(rem_path - devspec + 1, sizeof(idev->d_path))); - if (dev != NULL) - *dev = &idev->dd; + *dev = &idev->dd; if (path != NULL) *path = rem_path; return 0;