net/mlx5: Replace kfree with kvfree
authorChuhong Yuan <hslester96@gmail.com>
Wed, 17 Jul 2019 10:14:57 +0000 (18:14 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 18 Jul 2019 19:11:12 +0000 (12:11 -0700)
Variable allocated by kvmalloc should not be freed by kfree.
Because it may be allocated by vmalloc.
So replace kfree with kvfree here.

Fixes: 9b1f298236057 ("net/mlx5: Add support for FW fatal reporter dump")
Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
Acked-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx5/core/health.c

index 2fe6923f7ce086c3f6d357c00ce5bf41aca8a002..9314777d99e3f1e542e9cb5d4aa6960ac3849a10 100644 (file)
@@ -597,7 +597,7 @@ mlx5_fw_fatal_reporter_dump(struct devlink_health_reporter *reporter,
        err = devlink_fmsg_arr_pair_nest_end(fmsg);
 
 free_data:
-       kfree(cr_data);
+       kvfree(cr_data);
        return err;
 }