]> git.baikalelectronics.ru Git - kernel.git/commit
IB/mlx4: Fix shutdown crash accessing a non-existent bitmap
authorRoland Dreier <roland@purestorage.com>
Tue, 6 Dec 2011 18:47:37 +0000 (10:47 -0800)
committerRoland Dreier <roland@purestorage.com>
Tue, 6 Dec 2011 18:47:37 +0000 (10:47 -0800)
commit0c4be35fddea4eced2a6e3aef0d7ead5b36c15d5
treee243880d497d872c1c258799355598c13c00b737
parent5f37fd77fc10ff97c75733690f229345798c5c36
IB/mlx4: Fix shutdown crash accessing a non-existent bitmap

Commit 62a00b1049e3 ("IB/mlx4: Use flow counters on IBoE ports") added
code that sets elements of counters[] to -1 if no counter is allocated,
but then goes ahead and passes every entry to mlx4_counter_free() on
shutdown.  This is a bad idea, especially if MLX4_DEV_CAP_FLAG_COUNTERS
isn't set so there isn't even an underlying bitmap to free from.

Tested-by: Sean Hefty <sean.hefty@intel.com>
Cc: <stable@kernel.org>
Signed-off-by: Roland Dreier <roland@purestorage.com>
drivers/infiniband/hw/mlx4/main.c