X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;ds=sidebyside;f=drivers%2Fusb%2Fgadget%2Fusbstring.c;h=8c3ff64fe35359566a673a08791228d4f95989cf;hb=782acf7b52db6bec1a796773e3033b4afcd6c9e2;hp=6e9d1bf0f29b408c34df71834143d9a91cdb84ef;hpb=e7eb046a246e56f964804fea0e103fcbcf2a564e;p=u-boot diff --git a/drivers/usb/gadget/usbstring.c b/drivers/usb/gadget/usbstring.c index 6e9d1bf0f2..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; @@ -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]; } -