From 4883f347f6ed9a61f9789a3842077580250ebf44 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Fri, 13 Jan 2023 15:44:23 -0700 Subject: [PATCH] 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);