net/mlxfw: Fix out-of-memory error in mfa2 flash burning
authorVladyslav Tarasiuk <vladyslavt@mellanox.com>
Thu, 26 Dec 2019 08:41:56 +0000 (10:41 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 4 Jan 2020 18:13:33 +0000 (19:13 +0100)
commit6538eea79300eaaa8f517b6ed7a086913fd61afb
treeb60c58de2140164eb56ce2414e82a6afd767ca26
parent3990d6909f2f17b44ef43221bd30adffd9b8a5d1
net/mlxfw: Fix out-of-memory error in mfa2 flash burning

[ Upstream commit a5bcd72e054aabb93ddc51ed8cde36a5bfc50271 ]

The burning process requires to perform internal allocations of large
chunks of memory. This memory doesn't need to be contiguous and can be
safely allocated by vzalloc() instead of kzalloc(). This patch changes
such allocation to avoid possible out-of-memory failure.

Fixes: 410ed13cae39 ("Add the mlxfw module for Mellanox firmware flash process")
Signed-off-by: Vladyslav Tarasiuk <vladyslavt@mellanox.com>
Reviewed-by: Aya Levin <ayal@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Tested-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/mellanox/mlxfw/mlxfw_mfa2.c