X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;ds=sidebyside;f=drivers%2Fusb%2Fgadget%2Fusbstring.c;h=67e98c065d3d332f16381fe88d5ca6fd322b0ffd;hb=87fcdca6be8641d8aa7c4e31ccb6cb7d5177359e;hp=6e9d1bf0f29b408c34df71834143d9a91cdb84ef;hpb=6142e0ae0fcf8bf5a7a8d785061197ace8955cb6;p=u-boot diff --git a/drivers/usb/gadget/usbstring.c b/drivers/usb/gadget/usbstring.c index 6e9d1bf0f2..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; @@ -137,4 +137,3 @@ usb_gadget_get_string(struct usb_gadget_strings *table, int id, u8 *buf) buf[1] = USB_DT_STRING; return buf[0]; } -