]> git.karo-electronics.de Git - karo-tx-linux.git/commit
sfc: Fix loop condition for efx_filter_search() when !for_insert
authorBen Hutchings <bhutchings@solarflare.com>
Fri, 24 Jun 2011 19:26:44 +0000 (20:26 +0100)
committerBen Hutchings <bhutchings@solarflare.com>
Fri, 24 Jun 2011 23:43:48 +0000 (00:43 +0100)
commit4017dbdc14af1903dc9fcba4d08b89c02325069d
tree33c61638e1fb98ebf27f710e99f443aed9c2f738
parent22c8c9343258feda9ea9ebb9e5f8cbb727b69454
sfc: Fix loop condition for efx_filter_search() when !for_insert

efx_filter_remove_filter() fails to remove inserted filters in some cases.

For example:

  1. Two filters A and B have specifications that result in an initial
     hash collision.
  2. A is inserted first, followed by B.
  3. An attempt to remove B first succeeds, but if A is removed first
     a subsequent attempt to remove B fails.

When searching for an existing filter (!for_insert),
efx_filter_search() must always continue to the maximum search depth
for the given type rather than stopping at the first unused entry.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
drivers/net/sfc/filter.c