mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-13 15:03:58 +03:00
pci: Add checks for valid cmdline arguments
Currently pci command ignores invalid cmdline arguments and do something. Add checks that all passed arguments were processed. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Stefan Roese <sr@denx.de>
This commit is contained in:
@@ -523,7 +523,12 @@ static int do_pci(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
|
||||
}
|
||||
if (argc > 2 || (argc > 1 && cmd != 'r' && argv[1][0] != 's')) {
|
||||
busnum = hextoul(argv[argc - 1], NULL);
|
||||
argc--;
|
||||
}
|
||||
if (cmd == 'r' && argc > 2)
|
||||
goto usage;
|
||||
else if (cmd != 'r' && (argc > 2 || (argc == 2 && argv[1][0] != 's')))
|
||||
goto usage;
|
||||
}
|
||||
ret = uclass_get_device_by_seq(UCLASS_PCI, busnum, &bus);
|
||||
if (ret) {
|
||||
|
||||
Reference in New Issue
Block a user