X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=drivers%2Fusb%2Fgadget%2Fusbstring.c;h=67e98c065d3d332f16381fe88d5ca6fd322b0ffd;hb=87fcdca6be8641d8aa7c4e31ccb6cb7d5177359e;hp=95555cf96b9c3a1f1b52482c54c5ae9830ae3a2a;hpb=dfe161032d007e4901064ab36b58f054126b1f35;p=u-boot diff --git a/drivers/usb/gadget/usbstring.c b/drivers/usb/gadget/usbstring.c index 95555cf96b..67e98c065d 100644 --- a/drivers/usb/gadget/usbstring.c +++ b/drivers/usb/gadget/usbstring.c @@ -1,17 +1,14 @@ /* * Copyright (C) 2003 David Brownell * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published - * by the Free Software Foundation; either version 2.1 of the License, or - * (at your option) any later version. + * SPDX-License-Identifier: LGPL-2.1+ * - * Ported to U-boot by: Thomas Smits and + * Ported to U-Boot by: Thomas Smits and * Remy Bohmer */ #include -#include +#include #include #include @@ -111,6 +108,9 @@ usb_gadget_get_string(struct usb_gadget_strings *table, int id, u8 *buf) struct usb_string *s; int len; + if (!table) + return -EINVAL; + /* descriptor 0 has the language id */ if (id == 0) { buf[0] = 4;