]> git.baikalelectronics.ru Git - kernel.git/commit
i40evf: fix crash when changing ring sizes
authorMitch Williams <mitch.a.williams@intel.com>
Thu, 24 Apr 2014 06:41:37 +0000 (06:41 +0000)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Thu, 5 Jun 2014 09:13:01 +0000 (02:13 -0700)
commit8258e235433c40de6a69002621ab185781d2835e
treec8b273d1907855ccdb7e4351151acf075bf5c49f
parent36fa10bc43ca609dd1b41ce550e97dcd34f57591
i40evf: fix crash when changing ring sizes

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: Mitch Williams <mitch.a.williams@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/i40evf/i40evf.h
drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c
drivers/net/ethernet/intel/i40evf/i40evf_main.c