dxe: Check for available free descriptors

In dxeRXLogRefillRing, the descriptors are filled till the buffer
becomes empty without considering the avilable free descriptors. Added
check to this, also validated the max buffer length before processing
it.

Change-Id: I4f0a5820c9e639157b5dc1ef51a9dda8cc89aff2
CRs-Fixed: 887264
diff --git a/CORE/DXE/src/wlan_qct_dxe.c b/CORE/DXE/src/wlan_qct_dxe.c
index 21408b6..417bd89 100644
--- a/CORE/DXE/src/wlan_qct_dxe.c
+++ b/CORE/DXE/src/wlan_qct_dxe.c
@@ -2098,7 +2098,7 @@
    WLANDXE_DescType         *currentDesc    = NULL;
    wpt_uint32                xfrSize, allocatedLen = 0;
 
-   while(bufferLen > 0)
+   while(bufferLen > 0 && channelEntry->numFreeDesc > 0)
    {
       /* Current Control block is free
        * and associated frame buffer is not linked with control block anymore
diff --git a/CORE/WDI/CP/inc/wlan_qct_wdi.h b/CORE/WDI/CP/inc/wlan_qct_wdi.h
index bab070c..1972514 100644
--- a/CORE/WDI/CP/inc/wlan_qct_wdi.h
+++ b/CORE/WDI/CP/inc/wlan_qct_wdi.h
@@ -154,6 +154,7 @@
 #define WDI_DISA_MAX_PAYLOAD_SIZE                1600
 #define MAX_NUM_OF_BUFFER 3
 #define VALID_FW_LOG_TYPES      2
+#define MAX_LOG_BUFFER_LENGTH      128 * 1024
 
 /*============================================================================
  *     GENERIC STRUCTURES 
diff --git a/CORE/WDI/TRP/DTS/src/wlan_qct_wdi_dts.c b/CORE/WDI/TRP/DTS/src/wlan_qct_wdi_dts.c
index 1ee86f5..5b799d9 100644
--- a/CORE/WDI/TRP/DTS/src/wlan_qct_wdi_dts.c
+++ b/CORE/WDI/TRP/DTS/src/wlan_qct_wdi_dts.c
@@ -860,7 +860,7 @@
   for(i = 0; i < MAX_NUM_OF_BUFFER; i++)
   {
      pLoggingSession->logBuffAddress[i] = pLoggingMb->logBuffAddress[i];
-     if (!noMem)
+     if (!noMem && (pLoggingMb->logBuffLength[i] <= MAX_LOG_BUFFER_LENGTH))
      {
         pLoggingSession->logBuffLength[i] = gTransportDriver.setupLogTransfer(
                                                pLoggingMb->logBuffAddress[i],