net/ice: fix segmentation fault for RSS init

Message ID 1573024135-267218-1-git-send-email-simei.su@intel.com (mailing list archive)
State Superseded, archived
Delegated to: xiaolong ye
Headers
Series net/ice: fix segmentation fault for RSS init |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Performance-Testing fail build patch failure
ci/travis-robot warning Travis build: failed
ci/Intel-compilation fail Compilation issues

Commit Message

Simei Su Nov. 6, 2019, 7:08 a.m. UTC
  This patch fixes core dump issue when entering safe mode
with a wrong package file.

Fixes: 5ad3db8d4bdd ("net/ice: enable advanced RSS")

Signed-off-by: Simei Su <simei.su@intel.com>
---
 drivers/net/ice/ice_hash.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Stillwell Jr, Paul M Nov. 6, 2019, 4:03 p.m. UTC | #1
Can you provide more details on how this fixes the issue? Looking at the code, the pointer *parser should get set by the code so I'm not sure how this change does anything.

Paul

> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Simei Su
> Sent: Tuesday, November 5, 2019 11:09 PM
> To: Zhang, Qi Z <qi.z.zhang@intel.com>; Ye, Xiaolong <xiaolong.ye@intel.com>;
> Yang, Qiming <qiming.yang@intel.com>
> Cc: dev@dpdk.org; Su, Simei <simei.su@intel.com>
> Subject: [dpdk-dev] [PATCH] net/ice: fix segmentation fault for RSS init
> 
> This patch fixes core dump issue when entering safe mode with a wrong
> package file.
> 
> Fixes: 5ad3db8d4bdd ("net/ice: enable advanced RSS")
> 
> Signed-off-by: Simei Su <simei.su@intel.com>
> ---
>  drivers/net/ice/ice_hash.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ice/ice_hash.c b/drivers/net/ice/ice_hash.c index
> 3381b45..04ec30f 100644
> --- a/drivers/net/ice/ice_hash.c
> +++ b/drivers/net/ice/ice_hash.c
> @@ -236,7 +236,7 @@ struct ice_hash_match_type ice_hash_type_list[] = {
> static int  ice_hash_init(struct ice_adapter *ad)  {
> -	struct ice_flow_parser *parser = NULL;
> +	struct ice_flow_parser *parser;
> 
>  	if (ad->active_pkg_type == ICE_PKG_TYPE_OS_DEFAULT)
>  		parser = &ice_hash_parser_os;
> --
> 1.8.3.1
  

Patch

diff --git a/drivers/net/ice/ice_hash.c b/drivers/net/ice/ice_hash.c
index 3381b45..04ec30f 100644
--- a/drivers/net/ice/ice_hash.c
+++ b/drivers/net/ice/ice_hash.c
@@ -236,7 +236,7 @@  struct ice_hash_match_type ice_hash_type_list[] = {
 static int
 ice_hash_init(struct ice_adapter *ad)
 {
-	struct ice_flow_parser *parser = NULL;
+	struct ice_flow_parser *parser;
 
 	if (ad->active_pkg_type == ICE_PKG_TYPE_OS_DEFAULT)
 		parser = &ice_hash_parser_os;