summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
3932093)
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>
}
if (argc > 2 || (argc > 1 && cmd != 'r' && argv[1][0] != 's')) {
busnum = hextoul(argv[argc - 1], NULL);
}
if (argc > 2 || (argc > 1 && cmd != 'r' && argv[1][0] != 's')) {
busnum = hextoul(argv[argc - 1], NULL);
+ 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) {
}
ret = uclass_get_device_by_seq(UCLASS_PCI, busnum, &bus);
if (ret) {