All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] ice: Fix error return code in ice_init_hw()
@ 2018-03-28 12:50 ` Wei Yongjun
  0 siblings, 0 replies; 6+ messages in thread
From: Wei Yongjun @ 2018-03-28 12:50 UTC (permalink / raw)
  To: Jeff Kirsher; +Cc: Wei Yongjun, intel-wired-lan, netdev, kernel-janitors

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>
---
 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 385f5d4..21977ec 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);

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH net-next] ice: Fix error return code in ice_init_hw()
@ 2018-03-28 12:50 ` Wei Yongjun
  0 siblings, 0 replies; 6+ messages in thread
From: Wei Yongjun @ 2018-03-28 12:50 UTC (permalink / raw)
  To: Jeff Kirsher; +Cc: Wei Yongjun, intel-wired-lan, netdev, kernel-janitors

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>
---
 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 385f5d4..21977ec 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);


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Intel-wired-lan] [PATCH net-next] ice: Fix error return code in ice_init_hw()
@ 2018-03-28 12:50 ` Wei Yongjun
  0 siblings, 0 replies; 6+ messages in thread
From: Wei Yongjun @ 2018-03-28 12:50 UTC (permalink / raw)
  To: intel-wired-lan

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>
---
 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 385f5d4..21977ec 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);


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [Intel-wired-lan] [PATCH net-next] ice: Fix error return code in ice_init_hw()
  2018-03-28 12:50 ` Wei Yongjun
@ 2018-03-29 16:31   ` Venkataramanan, Anirudh
  -1 siblings, 0 replies; 6+ messages in thread
From: Venkataramanan, Anirudh @ 2018-03-29 16:31 UTC (permalink / raw)
  To: Kirsher, Jeffrey T, weiyongjun1; +Cc: netdev, intel-wired-lan, kernel-janitors

[-- Attachment #1: Type: text/plain, Size: 1244 bytes --]

On Wed, 2018-03-28 at 12:50 +0000, Wei Yongjun wrote:
> 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>
> ---
>  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 385f5d4..21977ec 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);
> 

Acked-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>

Thanks!
Ani

[-- Attachment #2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 3302 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Intel-wired-lan] [PATCH net-next] ice: Fix error return code in ice_init_hw()
@ 2018-03-29 16:31   ` Venkataramanan, Anirudh
  0 siblings, 0 replies; 6+ messages in thread
From: Venkataramanan, Anirudh @ 2018-03-29 16:31 UTC (permalink / raw)
  To: intel-wired-lan

On Wed, 2018-03-28 at 12:50 +0000, Wei Yongjun wrote:
> 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>
> ---
>  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 385f5d4..21977ec 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);
> 

Acked-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>

Thanks!
Ani
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3302 bytes
Desc: not available
URL: <http://lists.osuosl.org/pipermail/intel-wired-lan/attachments/20180329/75d04e0d/attachment.bin>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Intel-wired-lan] [PATCH net-next] ice: Fix error return code in ice_init_hw()
  2018-03-28 12:50 ` Wei Yongjun
                   ` (2 preceding siblings ...)
  (?)
@ 2018-03-29 22:02 ` Brelinski, TonyX
  -1 siblings, 0 replies; 6+ messages in thread
From: Brelinski, TonyX @ 2018-03-29 22:02 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On
> Behalf Of Wei Yongjun
> Sent: Wednesday, March 28, 2018 5:51 AM
> To: Kirsher, Jeffrey T <jeffrey.t.kirsher@intel.com>
> Cc: intel-wired-lan at lists.osuosl.org; kernel-janitors at vger.kernel.org; Wei
> Yongjun <weiyongjun1@huawei.com>; netdev at vger.kernel.org
> Subject: [Intel-wired-lan] [PATCH net-next] ice: Fix error return code in
> ice_init_hw()
> 
> 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>
> ---
>  drivers/net/ethernet/intel/ice/ice_common.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

Tested-by: Tony Brelinski <tonyx.brelinski@intel.com>



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-03-29 22:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-28 12:50 [PATCH net-next] ice: Fix error return code in ice_init_hw() Wei Yongjun
2018-03-28 12:50 ` [Intel-wired-lan] " Wei Yongjun
2018-03-28 12:50 ` Wei Yongjun
2018-03-29 16:31 ` [Intel-wired-lan] " Venkataramanan, Anirudh
2018-03-29 16:31   ` Venkataramanan, Anirudh
2018-03-29 22:02 ` Brelinski, TonyX

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.