pcie: shell: Verify command parameters

Exit on wrong parameter for pcie ls command.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
This commit is contained in:
Andrei Emeltchenko 2022-08-25 09:40:29 +03:00 committed by Fabio Baltieri
parent 7e9e3116e4
commit d46c7595d9

View file

@ -205,6 +205,11 @@ static int cmd_pcie_ls(const struct shell *sh, size_t argc, char **argv)
if (bdf == PCIE_BDF_NONE) {
bdf = get_bdf(argv[i]);
}
if (bdf == PCIE_BDF_NONE) {
shell_error(sh, "Unknown parameter: %s", argv[i]);
return -EINVAL;
}
}
/* Show only specified device */