]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - drivers/usb/gadget/usbstring.c
Merge branch 'master' of git://git.denx.de/u-boot-arm
[karo-tx-uboot.git] / drivers / usb / gadget / usbstring.c
index 6e9d1bf0f29b408c34df71834143d9a91cdb84ef..8c3ff64fe35359566a673a08791228d4f95989cf 100644 (file)
@@ -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 <ts.smits@gmail.com> and
  *                      Remy Bohmer <linux@bohmer.net>
@@ -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];
 }
-