From 9cd9d98300af3039db7f146a47914baef2e8ea1b Mon Sep 17 00:00:00 2001 From: Enrico Jorns Date: Mon, 12 Sep 2016 12:20:56 +0200 Subject: commands: exit on invalid option Barebox commands should not perform any action and return 0 if an invalid parameter was given. This might cause undetected unintended behvaior when calling commands with wrong options, either manually or from a script. Signed-off-by: Enrico Jorns Signed-off-by: Sascha Hauer --- commands/usbserial.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'commands/usbserial.c') diff --git a/commands/usbserial.c b/commands/usbserial.c index e80b315250..ad6bc63fcc 100644 --- a/commands/usbserial.c +++ b/commands/usbserial.c @@ -44,6 +44,8 @@ static int do_usbserial(int argc, char *argv[]) case 'd': usb_serial_unregister(); return 0; + default: + return COMMAND_ERROR_USAGE; } } -- cgit v1.2.3