[SPARC]: Fix EBUS use of uninitialized variable.
If of_get_property() fails, it returns NULL and the 'len' parameter is undefined. So we need to explicitly set len to zero in such cases. Noticed by Al Viro. Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
@@ -156,6 +156,8 @@ void __init fill_ebus_device(struct device_node *dp, struct linux_ebus_device *d
|
||||
dev->prom_node = dp;
|
||||
|
||||
regs = of_get_property(dp, "reg", &len);
|
||||
if (!regs)
|
||||
len = 0;
|
||||
if (len % sizeof(struct linux_prom_registers)) {
|
||||
prom_printf("UGH: proplen for %s was %d, need multiple of %d\n",
|
||||
dev->prom_node->name, len,
|
||||
|
Reference in New Issue
Block a user