The branch main has been updated by imp:

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

commit d38d8a4c4e9a3c4667307ac2163007ff193040b0
Author:     Warner Losh <[email protected]>
AuthorDate: 2023-01-13 21:19:39 +0000
Commit:     Warner Losh <[email protected]>
CommitDate: 2023-01-13 21:22:38 +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
---
 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;

Reply via email to