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
This commit is contained in:
Warner Losh 2023-01-13 14:19:39 -07:00
parent d1ea501714
commit d38d8a4c4e

View File

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