• Aaron Durbin's avatar
    mwifiex: don't leak DMA command skbuffs · 189b3299
    Aaron Durbin authored
    The current mwifiex pcie driver assumed that it would get
    its cmdrsp_complete() callback called before another command
    was sent to unmap the command's skbuff. However, that is not
    true. The mwifiex_check_ps_cond() will send a sleep command
    to the card without having adapter->curr_cmd set. Within the
    workqueue's state machine the adapter's state would be set
    to allow commands (curr_cmd = NULL && cmd_sent = false) after
    having receieved the response from the sleep command. The
    card->cmd_buf would then be overridden with the new command
    but the first command's skbuff was not unmapped. This leaks
    mapped skbuffs when a bounce buffer is employed.
    
    To rectify this unmap the card->cmd_buf when the response is
    received from the card instead of waiting for the
    cmdrsp_complete() callback.
    Signed-off-by: default avatarAaron Durbin <adurbin@chromium.org>
    Reviewed-by: default avatarPaul Stewart <pstew@chromium.org>
    Reviewed-by: default avatarAvinash Patil <patila@marvell.com>
    Signed-off-by: default avatarBing Zhao <bzhao@marvell.com>
    Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
    189b3299
pcie.c 63.7 KB