git: 2f7b00be106f - stable/13 - stand/ofw: dev can't be NULL here

From: Warner Losh <imp_at_FreeBSD.org>
Date: Tue, 24 Jan 2023 22:14:24 UTC
The branch stable/13 has been updated by imp:

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

commit 2f7b00be106ff560656c638bf44c6b92f1d823d8
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2023-01-13 21:19:39 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2023-01-24 21:49:46 +0000

    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
    
    (cherry picked from commit d38d8a4c4e9a3c4667307ac2163007ff193040b0)
---
 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;