• M
    i40evf: fix crash when changing ring sizes · d732a184
    Mitch Williams 提交于
    i40evf_set_ringparam was broken in several ways. First, it only changed
    the size of the first ring, and second, changing the ring size would
    often result in a panic because it would change the count before
    deallocating resources, causing the driver to either free nonexistent
    buffers, or leak leftover buffers.
    
    Fix this by storing the descriptor count in the adapter structure, and
    updating the count for each ring each time we allocate them. This
    ensures that we always free the right size ring, and always end up with
    the requested count when the device is (re)opened.
    
    Change-ID: I298396cd3d452ba8509d9f2d33a93f25868a9a55
    Signed-off-by: NMitch Williams <mitch.a.williams@intel.com>
    Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
    d732a184
i40evf.h 10.6 KB