bluetooth/btstack/avdtp/avdtpLogicalChannelFactory.cpp
changeset 51 20ac952a623c
parent 34 9d84592f5036
--- a/bluetooth/btstack/avdtp/avdtpLogicalChannelFactory.cpp	Thu Sep 23 17:06:47 2010 +0300
+++ b/bluetooth/btstack/avdtp/avdtpLogicalChannelFactory.cpp	Wed Oct 13 16:20:29 2010 +0300
@@ -672,6 +672,11 @@
 	{
 	LOG_FUNC
 	__ASSERT_DEBUG(iCurrentActiveJob && iCurrentActiveJob->iNumChannelsRequired, Panic(EAvdtpLogicalChannelFactoryJobHasNoLogicalChannels));
+	if(!(iCurrentActiveJob && iCurrentActiveJob->iNumChannelsRequired))
+	    {
+	    FLOG(_L("CLogicalChannelFactory::DoObtainChannelL called when current job was either non existant or not requiring channels."));
+	    User::Leave(KErrNotReady);
+	    }
 	
 	static const TInt KAVDTPPSM = 0x19;	
 	
@@ -720,6 +725,7 @@
 	// The call to ActiveOpen could affect iCurrentActiveJob if 
 	// L2CAP synchrononously errors -- in which case iCurrentActiveJob could now
 	// have become NULL. Make sure it is still valid.
+    // coverity[check_after_deref]
 	if (iCurrentActiveJob)
 		{		
 		// decrement how many more channels required for this job