[U-Boot] [PATCH] cmd: usb: check if_type before using this device

Simon Glass sjg at chromium.org
Sat Jun 18 01:00:01 CEST 2016


On 17 June 2016 at 00:18, Peng Fan <van.freenix at gmail.com> wrote:
> For legacy usb storage driver, USB_MAX_STOR_DEV is defined as 7.
> If we only have one usb disk on board, `usb dev 0` is ok.
> But if `usb dev 1`, still ok, then `usb read xxx` will trigger
> system fault and reboot.
>
> So check if_type before using this device.
>
> Signed-off-by: Peng Fan <peng.fan at nxp.com>
> Cc: Simon Glass <sjg at chromium.org>
> Cc: Hans de Goede <hdegoede at redhat.com>
> Cc: Bin Meng <bmeng.cn at gmail.com>
> Cc: Marek Vasut <marex at denx.de>
> Cc: Stefan Roese <sr at denx.de>
> Cc: Marcel Ziswiler <marcel.ziswiler at toradex.com>
> Cc: Peng Fan <peng.fan at nxp.com>
> Cc: Stephen Warren <swarren at nvidia.com>
> ---
>  cmd/usb.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Reviewed-by: Simon Glass <sjg at chromium.org>


More information about the U-Boot mailing list