Browse Source

net/mlx4_core: double free of dev_vfs

If user loads mlx4_core with num_vfs greater than
supported then variable dev->dev_vfs is freed 2 times after unloading the
driver.

Acked-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Carol L Soto <clsoto@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Carol L Soto 10 years ago
parent
commit
5114a04e6c
1 changed files with 1 additions and 0 deletions
  1. 1 0
      drivers/net/ethernet/mellanox/mlx4/main.c

+ 1 - 0
drivers/net/ethernet/mellanox/mlx4/main.c

@@ -2824,6 +2824,7 @@ disable_sriov:
 free_mem:
 	dev->persist->num_vfs = 0;
 	kfree(dev->dev_vfs);
+        dev->dev_vfs = NULL;
 	return dev_flags & ~MLX4_FLAG_MASTER;
 }