From: Michal Swiatkowski <michal.swiatkow...@intel.com>
When devlink reload is called port_info should stay. Check if it wasn't already
allocated before doing allocation.
Signed-off-by: Michal Swiatkowski <michal.swiatkow...@intel.com>
Signed-off-by: Anatoly Burakov <anatoly.bura...@intel.com>
---
drivers/net/ice/base/ice_common.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ice/base/ice_common.c
b/drivers/net/ice/base/ice_common.c
index ebbe8cde1d..914096d1a6 100644
--- a/drivers/net/ice/base/ice_common.c
+++ b/drivers/net/ice/base/ice_common.c
@@ -1006,7 +1006,8 @@ int ice_init_hw(struct ice_hw *hw)
if (status)
goto err_unroll_cqinit;
- hw->port_info = (struct ice_port_info *)
+ if (!hw->port_info)
+ hw->port_info = (struct ice_port_info *)
ice_malloc(hw, sizeof(*hw->port_info));
if (!hw->port_info) {
status = ICE_ERR_NO_MEMORY;
--
2.43.0