Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 774c1fe2 authored by Vipin Mehta's avatar Vipin Mehta Committed by Greg Kroah-Hartman
Browse files

staging: ath6kl: Fixing a memory leak



Virtual Scatter Gather Lists not getting freed during the HTCStop(). The
patch adds some clean up code in the code path.

Signed-off-by: default avatarVipin Mehta <vmehta@atheros.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent fb9b5487
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -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)
{
+2 −0
Original line number Diff line number Diff line
@@ -298,6 +298,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
#define DEV_ALLOC_SCATTER_REQ(pDev)             \
+2 −0
Original line number Diff line number Diff line
@@ -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"));