aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/misc/usbtest.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2017-10-22 08:36:53 -0400
committerDavid S. Miller <davem@davemloft.net>2017-10-22 08:39:14 -0400
commitf8ddadc4db6c7b7029b6d0e0d9af24f74ad27ca2 (patch)
tree0a6432aba336bae42313613f4c891bcfce02bd4e /drivers/usb/misc/usbtest.c
parentbdd091bab8c631bd2801af838e344fad34566410 (diff)
parentb5ac3beb5a9f0ef0ea64cd85faf94c0dc4de0e42 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
There were quite a few overlapping sets of changes here. Daniel's bug fix for off-by-ones in the new BPF branch instructions, along with the added allowances for "data_end > ptr + x" forms collided with the metadata additions. Along with those three changes came veritifer test cases, which in their final form I tried to group together properly. If I had just trimmed GIT's conflict tags as-is, this would have split up the meta tests unnecessarily. In the socketmap code, a set of preemption disabling changes overlapped with the rename of bpf_compute_data_end() to bpf_compute_data_pointers(). Changes were made to the mv88e6060.c driver set addr method which got removed in net-next. The hyperv transport socket layer had a locking change in 'net' which overlapped with a change of socket state macro usage in 'net-next'. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/usb/misc/usbtest.c')
-rw-r--r--drivers/usb/misc/usbtest.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/usb/misc/usbtest.c b/drivers/usb/misc/usbtest.c
index eee82ca55b7b..b3fc602b2e24 100644
--- a/drivers/usb/misc/usbtest.c
+++ b/drivers/usb/misc/usbtest.c
@@ -202,12 +202,13 @@ found:
202 return tmp; 202 return tmp;
203 } 203 }
204 204
205 if (in) { 205 if (in)
206 dev->in_pipe = usb_rcvbulkpipe(udev, 206 dev->in_pipe = usb_rcvbulkpipe(udev,
207 in->desc.bEndpointAddress & USB_ENDPOINT_NUMBER_MASK); 207 in->desc.bEndpointAddress & USB_ENDPOINT_NUMBER_MASK);
208 if (out)
208 dev->out_pipe = usb_sndbulkpipe(udev, 209 dev->out_pipe = usb_sndbulkpipe(udev,
209 out->desc.bEndpointAddress & USB_ENDPOINT_NUMBER_MASK); 210 out->desc.bEndpointAddress & USB_ENDPOINT_NUMBER_MASK);
210 } 211
211 if (iso_in) { 212 if (iso_in) {
212 dev->iso_in = &iso_in->desc; 213 dev->iso_in = &iso_in->desc;
213 dev->in_iso_pipe = usb_rcvisocpipe(udev, 214 dev->in_iso_pipe = usb_rcvisocpipe(udev,
@@ -1964,6 +1965,9 @@ test_queue(struct usbtest_dev *dev, struct usbtest_param_32 *param,
1964 int status = 0; 1965 int status = 0;
1965 struct urb *urbs[param->sglen]; 1966 struct urb *urbs[param->sglen];
1966 1967
1968 if (!param->sglen || param->iterations > UINT_MAX / param->sglen)
1969 return -EINVAL;
1970
1967 memset(&context, 0, sizeof(context)); 1971 memset(&context, 0, sizeof(context));
1968 context.count = param->iterations * param->sglen; 1972 context.count = param->iterations * param->sglen;
1969 context.dev = dev; 1973 context.dev = dev;
@@ -2087,6 +2091,8 @@ usbtest_do_ioctl(struct usb_interface *intf, struct usbtest_param_32 *param)
2087 2091
2088 if (param->iterations <= 0) 2092 if (param->iterations <= 0)
2089 return -EINVAL; 2093 return -EINVAL;
2094 if (param->sglen > MAX_SGLEN)
2095 return -EINVAL;
2090 /* 2096 /*
2091 * Just a bunch of test cases that every HCD is expected to handle. 2097 * Just a bunch of test cases that every HCD is expected to handle.
2092 * 2098 *