aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/misc/usbtest.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/misc/usbtest.c')
-rw-r--r--drivers/usb/misc/usbtest.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/usb/misc/usbtest.c b/drivers/usb/misc/usbtest.c
index 055b84adedac..7667b12f2ff5 100644
--- a/drivers/usb/misc/usbtest.c
+++ b/drivers/usb/misc/usbtest.c
@@ -423,6 +423,9 @@ alloc_sglist(int nents, int max, int vary)
423 unsigned i; 423 unsigned i;
424 unsigned size = max; 424 unsigned size = max;
425 425
426 if (max == 0)
427 return NULL;
428
426 sg = kmalloc_array(nents, sizeof *sg, GFP_KERNEL); 429 sg = kmalloc_array(nents, sizeof *sg, GFP_KERNEL);
427 if (!sg) 430 if (!sg)
428 return NULL; 431 return NULL;
@@ -2386,6 +2389,7 @@ static struct usbtest_info gz_info = {
2386 .name = "Linux gadget zero", 2389 .name = "Linux gadget zero",
2387 .autoconf = 1, 2390 .autoconf = 1,
2388 .ctrl_out = 1, 2391 .ctrl_out = 1,
2392 .iso = 1,
2389 .alt = 0, 2393 .alt = 0,
2390}; 2394};
2391 2395