lkml.org 
[lkml]   [2018]   [Jun]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.16 225/279] ixgbe: fix memory leak on ipsec allocation
    Date
    4.16-stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Colin Ian King <colin.king@canonical.com>

    [ Upstream commit c89ebb968f04c71e16e86c91caeacb045dc8f908 ]

    The error clean up path kfree's adapter->ipsec and should be
    instead kfree'ing ipsec. Fix this. Also, the err1 error exit path
    does not need to kfree ipsec because this failure path was for
    the failed allocation of ipsec.

    Detected by CoverityScan, CID#146424 ("Resource Leak")

    Fixes: 63a67fe229ea ("ixgbe: add ipsec offload add and remove SA")
    Signed-off-by: Colin Ian King <colin.king@canonical.com>
    Acked-by: Shannon Nelson <shannon.nelson@oracle.com>
    Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
    Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    ---
    drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c
    +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c
    @@ -918,8 +918,8 @@ err2:
    kfree(ipsec->ip_tbl);
    kfree(ipsec->rx_tbl);
    kfree(ipsec->tx_tbl);
    + kfree(ipsec);
    err1:
    - kfree(adapter->ipsec);
    netdev_err(adapter->netdev, "Unable to allocate memory for SA tables");
    }


    \
     
     \ /
      Last update: 2018-06-18 11:28    [W:2.684 / U:0.568 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site