Prevent possible usage of uninitialized pbase variable by checking
return value of fdt_get_range
This commit is contained in:
parent
b388a69a8d
commit
be9914fc31
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=244171
@ -206,8 +206,10 @@ uart_cpu_getdev(int devtype, struct uart_devinfo *di)
|
||||
err = fdt_regsize(node, &start, &size);
|
||||
if (err)
|
||||
return (ENXIO);
|
||||
err = fdt_get_range(OF_parent(node), 0, &pbase, &psize);
|
||||
if (err)
|
||||
pbase = 0;
|
||||
|
||||
fdt_get_range(OF_parent(node), 0, &pbase, &psize);
|
||||
start += pbase;
|
||||
|
||||
return (bus_space_map(di->bas.bst, start, size, 0, &di->bas.bsh));
|
||||
|
Loading…
Reference in New Issue
Block a user