usbatm xusbatm.c,1.3,1.4
kagan at infradead.org
kagan at infradead.org
Sat Apr 9 02:30:37 EDT 2005
Update of /home/cvs/usbatm
In directory phoenix.infradead.org:/tmp/cvs-serv29454
Modified Files:
xusbatm.c
Log Message:
Require the number of elements in each parameter array to be equal,
and assume everything else to be a user error
Index: xusbatm.c
===================================================================
RCS file: /home/cvs/usbatm/xusbatm.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- xusbatm.c 7 Apr 2005 14:48:51 -0000 1.3
+++ xusbatm.c 9 Apr 2005 06:30:34 -0000 1.4
@@ -85,18 +85,18 @@
static int __init xusbatm_init(void)
{
int i;
- int num_drivers = min_t(int,
- min_t(int, num_vendor, num_product),
- min_t(int, num_rx_endpoint, num_tx_endpoint));
dbg("xusbatm_init");
- if (!num_drivers) {
+ if (!num_vendor ||
+ num_vendor != num_product ||
+ num_vendor != num_rx_endpoint ||
+ num_vendor != num_tx_endpoint) {
warn("malformed module parameters");
return -EINVAL;
}
- for (i = 0; i < num_drivers; i++) {
+ for (i = 0; i < num_vendor; i++) {
xusbatm_usb_ids[i].match_flags = USB_DEVICE_ID_MATCH_DEVICE;
xusbatm_usb_ids[i].idVendor = vendor[i];
xusbatm_usb_ids[i].idProduct = product[i];
More information about the Usbatm-commits
mailing list