mmc: Fix incorrect handling of 'read' & 'write' commands
If a malformed 'read' or 'write' command is issued, the Sandbox U-Boot can crash because the command-handling code does no error checking on the number of provided arguments. This change makes the mmc 'erase', 'read' and 'write' commands only function if the proper number of arguments are supplied. Also puts the else assignment at the beginning fo the if() statement to shortens the generated code. This removes an unnecessary jump from the generated code. Signed-off-by: NTaylor Hutt <thutt@chromium.org> Signed-off-by: NSimon Glass <sjg@chromium.org> Signed-off-by: NAndy Fleming <afleming@freescale.com>
Showing
想要评论请 注册 或 登录