• Alexander Duyck's avatar
    ixgbe: Fix possible memory leak in ixgbe_set_ringparam · 1f4702aa
    Alexander Duyck authored
    We were not correctly freeing the temporary rings on error in
    ixgbe_set_ring_param.  In order to correct this I am unwinding a number of
    changes that were made in order to get things back to the original working
    form with modification for the current ring layouts.
    
    This approach has multiple advantages including a smaller memory footprint,
    and the fact that the interface is stopped while we are allocating the rings
    meaning that there is less potential for some sort of memory corruption on the
    ring.
    
    The only disadvantage I see with this approach is that on a Rx allocation
    failure we will report an error and only update the Tx rings.  However the
    adapter should be fully functional in this state and the likelihood of such
    an error is very low.  In addition it is not unreasonable to expect the
    user to need to recheck the ring configuration should they experience an
    error setting the ring sizes.
    Signed-off-by: default avatarAlexander Duyck <alexander.h.duyck@intel.com>
    Tested-by: default avatarPhil Schmitt <phillip.j.schmitt@intel.com>
    Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
    1f4702aa
ixgbe_ethtool.c 80.1 KB