kernel/eka/drivers/usbc/d_usbc.cpp
branchRCL_3
changeset 21 e7d2d738d3c2
parent 19 4a8fed1c0ef6
child 43 c1f20ce4abcf
--- a/kernel/eka/drivers/usbc/d_usbc.cpp	Fri Mar 12 15:50:11 2010 +0200
+++ b/kernel/eka/drivers/usbc/d_usbc.cpp	Mon Mar 15 12:45:50 2010 +0200
@@ -1959,7 +1959,12 @@
             // Parcel out the memory between endpoints
             TUint8* newAddr = reinterpret_cast<TUint8*>(chunk->LinearAddress());
             __KTRACE_OPT(KUSB, Kern::Printf("SetupInterfaceMemory alloc new chunk=0x%x, size=%d", newAddr,bufSizes[chunkInd]));
-            chunkChanged = (newAddr != oldAddr);
+            // The check is important to avoid chunkChanged to be corrupted.
+            // This code change is to fix the problem that one chunk is used by multiple interfaces.
+            if(!chunkChanged)
+            	{
+            	chunkChanged = (newAddr != oldAddr);
+            	}            
             aHwChunks[chunkInd] = chunk;
             }
         chunkInd++;