Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 Jan 2023 22:14:24 GMT
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 2f7b00be106f - stable/13 - stand/ofw: dev can't be NULL here
Message-ID:  <202301242214.30OMEOeO089788@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;



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