mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-11 15:37:23 +00:00
pci: Fix device_find_first_child() return value handling
This function only ever returns 0, but may not assign the second parameter. Same thing for device_find_next_child(). Do not assign ret to stop proliferation of this misuse. Reported-by: Jonas Karlman <jonas@kwiboo.se> Signed-off-by: Marek Vasut <marex@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
b99c635787
commit
8ee830d898
1 changed files with 3 additions and 4 deletions
|
@ -541,14 +541,13 @@ int pci_auto_config_devices(struct udevice *bus)
|
|||
struct pci_child_plat *pplat;
|
||||
unsigned int sub_bus;
|
||||
struct udevice *dev;
|
||||
int ret;
|
||||
|
||||
sub_bus = dev_seq(bus);
|
||||
debug("%s: start\n", __func__);
|
||||
pciauto_config_init(hose);
|
||||
for (ret = device_find_first_child(bus, &dev);
|
||||
!ret && dev;
|
||||
ret = device_find_next_child(&dev)) {
|
||||
for (device_find_first_child(bus, &dev);
|
||||
dev;
|
||||
device_find_next_child(&dev)) {
|
||||
unsigned int max_bus;
|
||||
int ret;
|
||||
|
||||
|
|
Loading…
Reference in a new issue