of: Fix endless loop in of_add_memory
of_add_memory is stuck in an endless loop when a memory bank with zero size is passed. Fix this. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
804fd9a469
commit
e60778e041
|
@ -1555,8 +1555,11 @@ int of_add_memory(struct device_node *node, bool dump)
|
|||
return -ENXIO;
|
||||
|
||||
while (!of_address_to_resource(node, n, &res)) {
|
||||
if (!resource_size(&res))
|
||||
if (!resource_size(&res)) {
|
||||
n++;
|
||||
continue;
|
||||
}
|
||||
|
||||
of_add_memory_bank(node, dump, n,
|
||||
res.start, resource_size(&res));
|
||||
n++;
|
||||
|
|
Loading…
Reference in New Issue