staging: ath6kl: Fixing a memory leak
authorVipin Mehta <vmehta@atheros.com>
Fri, 18 Feb 2011 21:13:09 +0000 (13:13 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 18 Feb 2011 21:28:51 +0000 (13:28 -0800)
Virtual Scatter Gather Lists not getting freed during the HTCStop(). The
patch adds some clean up code in the code path.

Signed-off-by: Vipin Mehta <vmehta@atheros.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/ath6kl/htc2/AR6000/ar6k.c
drivers/staging/ath6kl/htc2/AR6000/ar6k.h
drivers/staging/ath6kl/htc2/htc.c

index 6083231cdbb053a339a09cc628cd3209d6b23cbb..ff0480b5254bd8cc3531293885bf44dcb52adfa0 100644 (file)
@@ -810,6 +810,15 @@ static int DevSetupVirtualScatterSupport(AR6K_DEVICE *pDev)
     return status;
 }
 
+int DevCleanupMsgBundling(AR6K_DEVICE *pDev)
+{
+    if(NULL != pDev)
+    {
+        DevCleanupVirtualScatterSupport(pDev);
+    }
+
+    return 0;
+}
 
 int DevSetupMsgBundling(AR6K_DEVICE *pDev, int MaxMsgsPerTransfer)
 {
index d3b6b309dc2a3ed8e1f1c3dac7c9044fd109c70b..19d8e706057d306f48284b8d5e9d1d9a273e5599 100644 (file)
@@ -297,6 +297,8 @@ static INLINE int DEV_PREPARE_SCATTER_OPERATION(HIF_SCATTER_REQ *pReq)  {
         
     
 int DevSetupMsgBundling(AR6K_DEVICE *pDev, int MaxMsgsPerTransfer);
+
+int DevCleanupMsgBundling(AR6K_DEVICE *pDev);
                                   
 #define DEV_GET_MAX_MSG_PER_BUNDLE(pDev)        (pDev)->HifScatterInfo.MaxScatterEntries
 #define DEV_GET_MAX_BUNDLE_LENGTH(pDev)         (pDev)->HifScatterInfo.MaxTransferSizePerScatterReq
index 684eca9bd022cd763598526f891698f48f8029f2..e7adc45324af8b73e8ae0ae309948648cb0feb2c 100644 (file)
@@ -486,6 +486,8 @@ void HTCStop(HTC_HANDLE HTCHandle)
         /* flush all recv buffers */
     HTCFlushRecvBuffers(target);
 
+    DevCleanupMsgBundling(&target->Device);
+
     ResetEndpointStates(target);
    
     AR_DEBUG_PRINTF(ATH_DEBUG_TRC, ("-HTCStop \n"));