* [net 1/2] ice: Fix error return code in ice_init_hw()
2018-04-06 15:36 [net 0/2][pull request] Intel Wired LAN Driver Updates 2018-04-06 Jeff Kirsher
@ 2018-04-06 15:36 ` Jeff Kirsher
2018-04-06 15:36 ` [net 2/2] ice: Bug fixes in ethtool code Jeff Kirsher
2018-04-06 15:39 ` [net 0/2][pull request] Intel Wired LAN Driver Updates 2018-04-06 David Miller
2 siblings, 0 replies; 4+ messages in thread
From: Jeff Kirsher @ 2018-04-06 15:36 UTC (permalink / raw)
To: davem; +Cc: Wei Yongjun, netdev, nhorman, sassmann, jogreene, Jeff Kirsher
From: Wei Yongjun <weiyongjun1@huawei.com>
Fix to return error code ICE_ERR_NO_MEMORY from the alloc error
handling case instead of 0, as done elsewhere in this function.
Fixes: dc49c7723676 ("ice: Get MAC/PHY/link info and scheduler topology")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Acked-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>
Tested-by: Tony Brelinski <tonyx.brelinski@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/ice/ice_common.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/ice/ice_common.c b/drivers/net/ethernet/intel/ice/ice_common.c
index 385f5d425d19..21977ec984c4 100644
--- a/drivers/net/ethernet/intel/ice/ice_common.c
+++ b/drivers/net/ethernet/intel/ice/ice_common.c
@@ -468,8 +468,10 @@ enum ice_status ice_init_hw(struct ice_hw *hw)
mac_buf_len = sizeof(struct ice_aqc_manage_mac_read_resp);
mac_buf = devm_kzalloc(ice_hw_to_dev(hw), mac_buf_len, GFP_KERNEL);
- if (!mac_buf)
+ if (!mac_buf) {
+ status = ICE_ERR_NO_MEMORY;
goto err_unroll_fltr_mgmt_struct;
+ }
status = ice_aq_manage_mac_read(hw, mac_buf, mac_buf_len, NULL);
devm_kfree(ice_hw_to_dev(hw), mac_buf);
--
2.14.3
^ permalink raw reply related [flat|nested] 4+ messages in thread* [net 2/2] ice: Bug fixes in ethtool code
2018-04-06 15:36 [net 0/2][pull request] Intel Wired LAN Driver Updates 2018-04-06 Jeff Kirsher
2018-04-06 15:36 ` [net 1/2] ice: Fix error return code in ice_init_hw() Jeff Kirsher
@ 2018-04-06 15:36 ` Jeff Kirsher
2018-04-06 15:39 ` [net 0/2][pull request] Intel Wired LAN Driver Updates 2018-04-06 David Miller
2 siblings, 0 replies; 4+ messages in thread
From: Jeff Kirsher @ 2018-04-06 15:36 UTC (permalink / raw)
To: davem
Cc: Anirudh Venkataramanan, netdev, nhorman, sassmann, jogreene,
Jeff Kirsher
From: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>
1) Return correct size from ice_get_regs_len.
2) Fix incorrect use of ARRAY_SIZE in ice_get_regs.
Fixes: fcea6f3da546 (ice: Add stats and ethtool support)
Signed-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>
Tested-by: Tony Brelinski <tonyx.brelinski@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/ice/ice_ethtool.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/intel/ice/ice_ethtool.c b/drivers/net/ethernet/intel/ice/ice_ethtool.c
index 186764a5c263..1db304c01d10 100644
--- a/drivers/net/ethernet/intel/ice/ice_ethtool.c
+++ b/drivers/net/ethernet/intel/ice/ice_ethtool.c
@@ -156,7 +156,7 @@ ice_get_drvinfo(struct net_device *netdev, struct ethtool_drvinfo *drvinfo)
static int ice_get_regs_len(struct net_device __always_unused *netdev)
{
- return ARRAY_SIZE(ice_regs_dump_list);
+ return sizeof(ice_regs_dump_list);
}
static void
@@ -170,7 +170,7 @@ ice_get_regs(struct net_device *netdev, struct ethtool_regs *regs, void *p)
regs->version = 1;
- for (i = 0; i < ARRAY_SIZE(ice_regs_dump_list) / sizeof(u32); ++i)
+ for (i = 0; i < ARRAY_SIZE(ice_regs_dump_list); ++i)
regs_buf[i] = rd32(hw, ice_regs_dump_list[i]);
}
--
2.14.3
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [net 0/2][pull request] Intel Wired LAN Driver Updates 2018-04-06
2018-04-06 15:36 [net 0/2][pull request] Intel Wired LAN Driver Updates 2018-04-06 Jeff Kirsher
2018-04-06 15:36 ` [net 1/2] ice: Fix error return code in ice_init_hw() Jeff Kirsher
2018-04-06 15:36 ` [net 2/2] ice: Bug fixes in ethtool code Jeff Kirsher
@ 2018-04-06 15:39 ` David Miller
2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2018-04-06 15:39 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, nhorman, sassmann, jogreene
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Fri, 6 Apr 2018 08:36:28 -0700
> This series contains a couple of fixes for the new ice driver.
>
> Wei Yongjun fixes the return error code for error case during init.
>
> Anirudh fixes the incorrect use of ARRAY_SIZE() in the ice ethtool code
> and fixed "for" loop calculations.
Pulled, thanks Jeff.
^ permalink raw reply [flat|nested] 4+ messages in thread