Am Dienstag, 4. November 2008 21:34:43 schrieb Jiri Slaby: > Oliver Neukum napsal(a): > > Am Dienstag, 4. November 2008 16:33:49 schrieb Jiri Slaby: > >> Oliver Neukum napsal(a): > >>> Yes, I see. However, the device must not be registered before the table > >>> is correctly filled and the minor must be filled out before. A mutex then? > >> It's enough to assign the hiddev_table after the register, isn't it? > >> Actually, it's how it's done now... BTW what was the reason to move with that? > > > > No, you have a race condition where open() for an announced device > > will fail. > > Could you expand this? I don't understand. > If you call usb_register_dev() before you set hiddev_table[usbhid->intf->minor - HIDDEV_MINOR_BASE] this check in hiddev_open() may fail: if (i >= HIDDEV_MINORS || i < 0 || !hiddev_table[i]) return -ENODEV; Regards Oliver -- To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html