Commit 04cbaa6c authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Tony Nguyen

ice: Simplify memory allocation in ice_sched_init_port()

'buf' is locale to the ice_sched_init_port() 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>
Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
parent 1b9e740d
......@@ -1212,7 +1212,7 @@ int ice_sched_init_port(struct ice_port_info *pi)
hw = pi->hw;
/* Query the Default Topology from FW */
buf = devm_kzalloc(ice_hw_to_dev(hw), ICE_AQ_MAX_BUF_LEN, GFP_KERNEL);
buf = kzalloc(ICE_AQ_MAX_BUF_LEN, GFP_KERNEL);
if (!buf)
return -ENOMEM;
......@@ -1290,7 +1290,7 @@ int ice_sched_init_port(struct ice_port_info *pi)
pi->root = NULL;
}
devm_kfree(ice_hw_to_dev(hw), buf);
kfree(buf);
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