# This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.569 -> 1.570 # drivers/usb/core/usb.c 1.48 -> 1.49 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 02/04/26 greg@kroah.com 1.570 # USB core # # added check for num_minors at registration time to catch buggy drivers. # -------------------------------------------- # diff -Nru a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c --- a/drivers/usb/core/usb.c Fri Apr 26 16:05:35 2002 +++ b/drivers/usb/core/usb.c Fri Apr 26 16:05:35 2002 @@ -115,6 +115,11 @@ { int retval = 0; + if ((new_driver->fops) && (new_driver->num_minors == 0)) { + err ("%s driver must specify num_minors", new_driver->name); + return -EINVAL; + } + #ifndef CONFIG_USB_DYNAMIC_MINORS if (new_driver->fops != NULL) { retval = usb_register_minors (new_driver, new_driver->num_minors, new_driver->minor);