Fix panics on attempt to dereference uninitizlized pointer, returned via
'path' argument of ofw_parsedev() if devspec refers raw device with no path. For example, `ls /pci@1f,0/ide@d/disk@0,0:a/` works fine, while `ls /pci@1f,0/ide@d/disk@0,0:a` panicked before this change.
This commit is contained in:
parent
e67c0426bc
commit
1123f298f3
@ -105,7 +105,7 @@ ofw_parsedev(struct ofw_devdesc **dev, const char *devspec, const char **path)
|
||||
return(ENOENT);
|
||||
|
||||
found:
|
||||
if (path != NULL && *s != '\0')
|
||||
if (path != NULL)
|
||||
*path = s;
|
||||
idev = malloc(sizeof(struct ofw_devdesc));
|
||||
if (idev == NULL) {
|
||||
|
Loading…
Reference in New Issue
Block a user