From: Carol L Soto Date: Tue, 2 Jun 2015 21:07:23 +0000 (-0500) Subject: net/mlx4_core: double free of dev_vfs X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=5114a04e6c73a0c6e74737e801b8a3b3d40c7e36;p=linux-beck.git 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 Signed-off-by: Carol L Soto Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c index 0dbd70427221..9485cbef5166 100644 --- a/drivers/net/ethernet/mellanox/mlx4/main.c +++ b/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; }