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 13:00:11 +0000 (14:00 +0100)
commitb8ae180a2500819f4d19b620f112a1386ef4cd3c
tree02873a11680eeea7745763d8b0b3b96e66992ba4
parenta6585c5b85341072f861f1b15e6378ddaf3c27e1
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