Am 14.06.2016 um 21:57 schrieb Oliver Neukum: > On Tue, 2016-06-14 at 21:34 +0200, Heiner Kallweit wrote: >> Am 14.06.2016 um 10:05 schrieb Oliver Neukum: >>> On Tue, 2016-06-14 at 07:51 +0200, Heiner Kallweit wrote: >>> >>>> + ret = hid_hw_start(hdev, HID_CONNECT_HIDRAW); >>>> + if (ret) >>>> + return ret; >>>> + >>>> + minor = ((struct hidraw *) hdev->hidraw)->minor; >>>> + >>>> + ret = dc_init_device(dcdev); >>> >>> That is a race condition. You announced an uninitialized device to the >>> rest of the system. >>> >> I don't see a race. The hdev and lock elements of dcdev are initialized > > You have called hid_hw_start(). That implies that the device be ready. > OK, now I see your point, thanks. And right, it's better to call hid_hw_start later. Rgds, Heiner >> and dc_init_device just calls dc_send to send the init command to the device. >> It doesn't announce anything. > > You send the init command after the rest of the system already sees the > device. > > Regards > Oliver > > > -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html