Commit 1b9e740d authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Tony Nguyen

ice: switch: Simplify memory allocation

'rbuf' is locale to the ice_get_initial_sw_cfg() function.
There is no point in using devm_kzalloc()/devm_kfree().

use kzalloc()/kfree() instead.
Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: default avatarMichal Swiatkowski <michal.swiatkowski@linux.intel.com>
Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
parent 1bd50f2d
...@@ -2274,9 +2274,7 @@ int ice_get_initial_sw_cfg(struct ice_hw *hw) ...@@ -2274,9 +2274,7 @@ int ice_get_initial_sw_cfg(struct ice_hw *hw)
int status; int status;
u16 i; u16 i;
rbuf = devm_kzalloc(ice_hw_to_dev(hw), ICE_SW_CFG_MAX_BUF_LEN, rbuf = kzalloc(ICE_SW_CFG_MAX_BUF_LEN, GFP_KERNEL);
GFP_KERNEL);
if (!rbuf) if (!rbuf)
return -ENOMEM; return -ENOMEM;
...@@ -2324,7 +2322,7 @@ int ice_get_initial_sw_cfg(struct ice_hw *hw) ...@@ -2324,7 +2322,7 @@ int ice_get_initial_sw_cfg(struct ice_hw *hw)
} }
} while (req_desc && !status); } while (req_desc && !status);
devm_kfree(ice_hw_to_dev(hw), rbuf); kfree(rbuf);
return status; return status;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment