]> 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)
commit93fe924f4bafc96d94f5851535c7d018344ec121
treec8b273d1907855ccdb7e4351151acf075bf5c49f
parent76ef5b853d45da373b72c13c36ea9dd1b23e9c75
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