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
This commit is contained in:
Warner Losh 2023-01-13 15:44:23 -07:00
parent 92e978439f
commit 4883f347f6

View File

@ -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);