diff -r 597aaf25e343 -r e7d2d738d3c2 kernel/eka/drivers/usbcc/ps_usbc.cpp --- a/kernel/eka/drivers/usbcc/ps_usbc.cpp Fri Mar 12 15:50:11 2010 +0200 +++ b/kernel/eka/drivers/usbcc/ps_usbc.cpp Mon Mar 15 12:45:50 2010 +0200 @@ -180,11 +180,13 @@ } DeActivateHardwareController(); // turn off UDC altogether iStackIsActive = EFalse; + // Notify registered clients on the user side about a USB device state + // change event and a transition to the "Undefined" state. + // Note: the state should be changed to "Undefined" before calling RunClientCallbacks(), + // otherwise the "Undefined" state will probably be lost. + NextDeviceState(EUsbcDeviceStateUndefined); // Complete all pending requests, returning KErrDisconnected RunClientCallbacks(); - // Notify registered clients on the user side about a USB device state - // change event and a transition to the "Undefined" state. - NextDeviceState(EUsbcDeviceStateUndefined); }