The branch main has been updated by imp:

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

commit 4883f347f6ed9a61f9789a3842077580250ebf44
Author:     Warner Losh <[email protected]>
AuthorDate: 2023-01-13 22:44:23 +0000
Commit:     Warner Losh <[email protected]>
CommitDate: 2023-01-13 22:54:44 +0000

    stand: dev can't be NULL in default_prasedev
    
    We pass in the address of a variable to store this value always in the
    only place that calls this function, so there is no need to test for NULL.
    
    Sponsored by:           Netflix
    Notied by:              tsoome in D38041
---
 stand/libsa/dev.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/stand/libsa/dev.c b/stand/libsa/dev.c
index 6d1834c8a14a..e76be6cd0eb0 100644
--- a/stand/libsa/dev.c
+++ b/stand/libsa/dev.c
@@ -100,10 +100,7 @@ default_parsedev(struct devdesc **dev, const char *devspec,
        idev->d_unit = unit;
        if (path != NULL)
                *path = (*cp == 0) ? cp : cp + 1;
-       if (dev != NULL)        /* maybe this can be required? */
-               *dev = idev;
-       else
-               free(idev);
+       *dev = idev;
        return (0);
 fail:
        free(idev);

Reply via email to