X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=drivers%2Fusb%2Fgadget%2Fusbstring.c;h=83cdd8a2595e1c92aafbd5df6e404845abcf64f3;hb=c02712a7484918648e5dd09c092035c7eeb7794a;hp=de5fa3f6483f3e5529b01cceb599146aa7c07b16;hpb=eee479cf6a4046d25f8032c402355d9fc237fb70;p=oweals%2Fu-boot.git diff --git a/drivers/usb/gadget/usbstring.c b/drivers/usb/gadget/usbstring.c index de5fa3f648..83cdd8a259 100644 --- a/drivers/usb/gadget/usbstring.c +++ b/drivers/usb/gadget/usbstring.c @@ -1,14 +1,13 @@ +// SPDX-License-Identifier: LGPL-2.1+ /* * Copyright (C) 2003 David Brownell * - * 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 @@ -108,6 +107,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;