X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=drivers%2Fusb%2Fgadget%2Fusbstring.c;h=8c3ff64fe35359566a673a08791228d4f95989cf;hb=782acf7b52db6bec1a796773e3033b4afcd6c9e2;hp=95555cf96b9c3a1f1b52482c54c5ae9830ae3a2a;hpb=d963e84c92a63b4e6c4f2f80482a5ecbe9b24fe0;p=u-boot diff --git a/drivers/usb/gadget/usbstring.c b/drivers/usb/gadget/usbstring.c index 95555cf96b..8c3ff64fe3 100644 --- a/drivers/usb/gadget/usbstring.c +++ b/drivers/usb/gadget/usbstring.c @@ -1,10 +1,7 @@ /* * 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 * Remy Bohmer @@ -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;