MX28: Fix MXSBOOT segfault if no params specified

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Cc: Wolfgang Denk <wd@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
diff --git a/tools/mxsboot.c b/tools/mxsboot.c
index 176753d..8246831 100644
--- a/tools/mxsboot.c
+++ b/tools/mxsboot.c
@@ -606,6 +606,9 @@
 	};
 	int type;
 
+	if (argc < 4)
+		return -1;
+
 	for (i = 1; i < argc; i++) {
 		if (!strncmp(argv[i], "-w", 2))
 			type = PARAM_WRITE;