diff -r 9e2d4f7f5028 -r 345b1ca54e88 userlibandfileserver/fileserver/shostmassstorage/server/controller/cusbhostmsdevicethread.cpp --- a/userlibandfileserver/fileserver/shostmassstorage/server/controller/cusbhostmsdevicethread.cpp Tue Sep 14 23:56:21 2010 +0300 +++ b/userlibandfileserver/fileserver/shostmassstorage/server/controller/cusbhostmsdevicethread.cpp Wed Sep 15 13:42:27 2010 +0300 @@ -173,11 +173,16 @@ { if (iUsbHostMsDevice->IsSuspended()) { - // request resume - Unlock(); - iUsbHostMsDevice->Resume(iStatus); - SetActive(); - return; + + RMessage2 msg = iRMessage2[iDequeueIndex]; + if (msg.Function() != EUsbHostMsSuspendLun) + { + // request resume + Unlock(); + iUsbHostMsDevice->Resume(iStatus); + SetActive(); + return; + } } } @@ -309,8 +314,11 @@ return; case EUsbHostMsUnRegisterInterface: // Check whether all luns have got uninitialised. - for(TInt i = 0, j = iUsbHostMsDevice->GetMaxLun(); i <= j; i++) - TRAP_IGNORE(iUsbHostMsDevice->RemoveLunL(i)); + if (iUsbHostMsDevice) + { + for(TInt i = 0, j = iUsbHostMsDevice->GetMaxLun(); i <= j; i++) + TRAP_IGNORE(iUsbHostMsDevice->RemoveLunL(i)); + } TRAP(ret, UnRegisterInterfaceL(aMessage)); break; case EUsbHostMsRegisterLun: