fix coverity reported issues
cover fix coverity reported issues
Fix issues reported by Coverity.
Note that one issue was reported in internal coverity scan.
Ajit Khaparde (1):
net/bnxt: fix uninitialized variable error
Kishore Padmanabha (1):
net/bnxt: fix overrun of the ulp device params array
drivers/net/bnxt/tf_core/tf_tbl.c | 2 +- drivers/net/bnxt/tf_ulp/ulp_template_db.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
Signature · 1 line
2.21.1 (Apple Git-122.3)
PATCH 1/2 net/bnxt: fix overrun of the ulp device params array
From: Kishore Padmanabha <[email protected]>
Fix a buffer overrun issue spotted by coverity while accessing the array ulp_device_params.
--- drivers/net/bnxt/tf_ulp/ulp_template_db.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/bnxt/tf_ulp/ulp_template_db.c +1 -1
@@ -321,7 +321,7 @@ struct bnxt_ulp_def_ident_info ulp_def_ident_tbl[] = { } }; -struct bnxt_ulp_device_params ulp_device_params[] = { +struct bnxt_ulp_device_params ulp_device_params[BNXT_ULP_DEVICE_ID_LAST ] = { [BNXT_ULP_DEVICE_ID_WH_PLUS ] = { .global_fid_enable =BNXT_ULP_SYM_YES , .byte_order = (enum bnxt_ulp_byte_order)
Signature · 1 line
2.21.1 (Apple Git-122.3)
Re: [dpdk-dev] [PATCH 1/2] net/bnxt: fix overrun of the ulp device params array
Quoted 4 lines · Ajit Khaparde
From: Kishore Padmanabha <[email protected]>
Fix a buffer overrun issue spotted by coverity while accessing the array
ulp_device_params.
If it is spotted by coverity, is there a coverity issue id?
Quoted 24 lines
Fixes 313ac35ac701 ("net/bnxt: support ULP session manager init")Signed-off-by Kishore Padmanabha <[email protected]>Reviewed-by Michael Baucom <[email protected]>Reviewed-by Ajit Khaparde <[email protected]>--- drivers/net/bnxt/tf_ulp/ulp_template_db.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/bnxt/tf_ulp/ulp_template_db.c +1
-1@@ -321,7 +321,7 @@ struct bnxt_ulp_def_ident_info ulp_def_ident_tbl[] = { } }; -struct bnxt_ulp_device_params ulp_device_params[] = { +struct bnxt_ulp_device_params ulp_device_params[BNXT_ULP_DEVICE_ID_LAST ] = { [BNXT_ULP_DEVICE_ID_WH_PLUS ] = { .global_fid_enable =BNXT_ULP_SYM_YES , .byte_order = (enum bnxt_ulp_byte_order)
Re: [dpdk-dev] [PATCH 1/2] net/bnxt: fix overrun of the ulp device params array
Quoted 8 lines · Ferruh Yigit
Quoted 4 lines · Ajit Khaparde
From: Kishore Padmanabha <[email protected]>
Fix a buffer overrun issue spotted by coverity while accessing the array
ulp_device_params.If it is spotted by coverity, is there a coverity issue id?
Yes. But in an internal scan.
I haven't seen anything reported in this area in the latest coverity report against 20.05-rc1.
Quoted 29 lines
Review
Quoted 11 lines
Fixes 313ac35ac701 ("net/bnxt: support ULP session manager init")Signed-off-by Kishore Padmanabha <[email protected]>Reviewed-by Michael Baucom <[email protected]>Reviewed-by Ajit Khaparde <[email protected]>--- drivers/net/bnxt/tf_ulp/ulp_template_db.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)(quoted diff) +0
-0
b/drivers/net/bnxt/tf_ulp/ulp_template_db.cdrivers/net/bnxt/tf_ulp/ulp_template_db.c struct bnxt_ulp_def_ident_info ulp_def_ident_tbl[] =
Quoted 4 lines
index
86384169f..e89aefad4100644drivers/net/bnxt/tf_ulp/ulp_template_db.c +0
-0@@ -321,7 +321,7 @@ struct bnxt_ulp_def_ident_info ulp_def_ident_tbl[] ={
drivers/net/bnxt/tf_ulp/ulp_template_db.c struct bnxt_ulp_def_ident_info ulp_def_ident_tbl[] = {
Quoted 5 lines
drivers/net/bnxt/tf_ulp/ulp_template_db.c +1
-1} }; -struct bnxt_ulp_device_params ulp_device_params[] = { +struct bnxt_ulp_device_params ulp_device_params[BNXT_ULP_DEVICE_ID_LAST] = {
Quoted 4 lines
drivers/net/bnxt/tf_ulp/ulp_template_db.c +0
-0[BNXT_ULP_DEVICE_ID_WH_PLUS ] = { .global_fid_enable =BNXT_ULP_SYM_YES , .byte_order = (enum bnxt_ulp_byte_order)
Re: [dpdk-dev] [PATCH 1/2] net/bnxt: fix overrun of the ulp device params array
Quoted 9 lines · Ajit Khaparde
On Wed, May 6, 2020 at 2:17 AM Ferruh Yigit <[email protected] <mailto:[email protected]>> wrote:
On 5/5/2020 8:17 PM, Ajit Khaparde wrote:
> From: Kishore Padmanabha <[email protected] <mailto:[email protected]>>
>
Quoted 8 lines
> Fix a buffer overrun issue spotted by coverity while accessing > the array
ulp_device_params.If it is spotted by coverity, is there a coverity issue id?
Yes. But in an internal scan.
I haven't seen anything reported in this area in the latest coverity report against 20.05-rc1.
Thanks for checking, I wonder what is the difference so that it is not in public converity.
Can you please mention in commit log that it is internal coverity, to prevent same confusion later?
Quoted 31 lines
Quoted 6 lines
Fixes 313ac35ac701 ("net/bnxt: support ULP session manager init")Signed-off-by Kishore Padmanabha <[email protected]<mailto:[email protected]>> > Reviewed-by: Michael Baucom <[email protected] <mailto:[email protected]>> > Reviewed-by: Ajit Khaparde <[email protected] <mailto:[email protected]>> > --- > drivers/net/bnxt/tf_ulp/ulp_template_db.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/bnxt/tf_ulp/ulp_template_db.c b/drivers/net/bnxt/tf_ulp/ulp_template_db.c > index 86384169f..e89aefad4 100644 > --- a/drivers/net/bnxt/tf_ulp/ulp_template_db.c > +++ b/drivers/net/bnxt/tf_ulp/ulp_template_db.c > @@ -321,7 +321,7 @@ struct bnxt_ulp_def_ident_info ulp_def_ident_tbl[] = { > } > }; > > -struct bnxt_ulp_device_params ulp_device_params[] = { > +struct bnxt_ulp_device_params ulp_device_params[BNXT_ULP_DEVICE_ID_LAST] = { > [BNXT_ULP_DEVICE_ID_WH_PLUS] = { > .global_fid_enable = BNXT_ULP_SYM_YES, > .byte_order = (enum bnxt_ulp_byte_order) >
Re: [dpdk-dev] [PATCH 1/2] net/bnxt: fix overrun of the ulp device params array
Quoted 18 lines · Ferruh Yigit
Quoted 9 lines · Ajit Khaparde
On Wed, May 6, 2020 at 2:17 AM Ferruh Yigit <[email protected] <mailto:[email protected]>> wrote:
On 5/5/2020 8:17 PM, Ajit Khaparde wrote:
> From: Kishore Padmanabha <[email protected] <mailto:[email protected]>>
>Quoted 7 lines
> Fix a buffer overrun issue spotted by coverity while accessing > the array
ulp_device_params.If it is spotted by coverity, is there a coverity issue id?
Yes. But in an internal scan.
I haven't seen anything reported in this area in the latest coverityreport
Quoted 9 lines
Quoted 1 line
against 20.05-rc1.
Thanks for checking, I wonder what is the difference so that it is not in public
converity.
Can you please mention in commit log that it is internal coverity, to prevent
same confusion later?
Done. Sent a v2 as well.
Quoted 36 lines
Quoted 7 lines
Quoted 7 lines
Fixes 313ac35ac701 ("net/bnxt: support ULP session manager init")Signed-off-by Kishore Padmanabha <[email protected]Quoted 15 lines
<mailto:[email protected]>> > Reviewed-by: Michael Baucom <[email protected] <mailto:[email protected]>> > Reviewed-by: Ajit Khaparde <[email protected] <mailto:[email protected]>> > --- > drivers/net/bnxt/tf_ulp/ulp_template_db.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/bnxt/tf_ulp/ulp_template_db.c b/drivers/net/bnxt/tf_ulp/ulp_template_db.c > index 86384169f..e89aefad4 100644 > --- a/drivers/net/bnxt/tf_ulp/ulp_template_db.c > +++ b/drivers/net/bnxt/tf_ulp/ulp_template_db.c > @@ -321,7 +321,7 @@ struct bnxt_ulp_def_ident_infoulp_def_ident_tbl[] = {
Quoted 5 lines
Review
Quoted 5 lines
}};
(quoted diff) +1
-1-struct bnxt_ulp_device_params ulp_device_params[] = { +struct bnxt_ulp_device_paramsulp_device_params[BNXT_ULP_DEVICE_ID_LAST] = {
Quoted 5 lines
Quoted 4 lines
[
BNXT_ULP_DEVICE_ID_WH_PLUS] = {
.global_fid_enable =BNXT_ULP_SYM_YES,
.byte_order = (enumbnxt_ulp_byte_order)
PATCH 2/2 net/bnxt: fix uninitialized variable error
In reply to Ajit KhapardeFix uninitialized variable error reported by coverity.
Coverity issue: 357771
--- drivers/net/bnxt/tf_core/tf_tbl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/bnxt/tf_core/tf_tbl.c +1 -1
@@ -539,7 +539,7 @@ tf_em_ctx_reg(struct tf *tfp, {struct tf_em_ctx_mem_info *ctxp = &tbl_scope_cb->em_ctx_info[dir];struct tf_em_table *tbl; -int rc; +int rc =0 ;int i;for (i =KEY0_TABLE ; i <MAX_TABLE ; i++) {
Signature · 1 line
2.21.1 (Apple Git-122.3)
Re: [dpdk-dev] [PATCH 2/2] net/bnxt: fix uninitialized variable error
Quoted 3 lines · Ajit Khaparde
Fix uninitialized variable error reported by coverity.
Fixes d33b68154fa4 ("net/bnxt: add tf_core table scope support")
The commit id and the patch title doesn't exist in next-net (also not int next-net-brcm), I guess you mean [1] but the updated function below ('tf_em_ctx_reg()') even not exist in that commit.
Can you please check the tag again?
[1] net/bnxt: support TruFlow core table scope
Quoted 23 lines
Coverity issue: 357771
Signed-off-by Ajit Khaparde <[email protected]>Reviewed-by Somnath Kotur <[email protected]>Reviewed-by Randy Schacher <[email protected]>--- drivers/net/bnxt/tf_core/tf_tbl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/bnxt/tf_core/tf_tbl.c +1
-1@@ -539,7 +539,7 @@ tf_em_ctx_reg(struct tf *tfp, {struct tf_em_ctx_mem_info *ctxp = &tbl_scope_cb->em_ctx_info[dir];struct tf_em_table *tbl; -int rc; +int rc =0 ;int i;for (i =KEY0_TABLE ; i <MAX_TABLE ; i++) {
Re: [dpdk-dev] [PATCH 2/2] net/bnxt: fix uninitialized variable error
Quoted 5 lines · Ferruh Yigit
Quoted 3 lines · Ajit Khaparde
Fix uninitialized variable error reported by coverity.
Fixes d33b68154fa4 ("net/bnxt: add tf_core table scope support")
Quoted 8 lines
The commit id and the patch title doesn't exist in next-net (also not int next-net-brcm), I guess you mean [1] but the updated function below ('
tf_em_ctx_reg()') even not exist in that commit.Can you please check the tag again?
[1] net/bnxt: support TruFlow core table scope
Yes [1] is the correct commit.dba3ca8b304f ("net/bnxt: support TruFlow core table scope").
Quoted 27 lines
Review
Quoted 11 lines
Coverity issue: 357771
Signed-off-by Ajit Khaparde <[email protected]>Reviewed-by Somnath Kotur <[email protected]>Reviewed-by Randy Schacher <[email protected]>--- drivers/net/bnxt/tf_core/tf_tbl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)(quoted diff) +0
-0
b/drivers/net/bnxt/tf_core/tf_tbl.cQuoted 13 lines
index
93f387e86..d900c9c09100644drivers/net/bnxt/tf_core/tf_tbl.c +1
-1@@ -539,7 +539,7 @@ tf_em_ctx_reg(struct tf *tfp, {struct tf_em_ctx_mem_info *ctxp = &tbl_scope_cb->em_ctx_info[dir];struct tf_em_table *tbl; -int rc; +int rc =0 ;int i;for (i =KEY0_TABLE ; i <MAX_TABLE ; i++) {
Re: [dpdk-dev] [PATCH 2/2] net/bnxt: fix uninitialized variable error
Quoted 14 lines · Ajit Khaparde
On Wed, May 6, 2020 at 2:14 AM Ferruh Yigit <[email protected] <mailto:[email protected]>> wrote:
On 5/5/2020 8:17 PM, Ajit Khaparde wrote:
> Fix uninitialized variable error reported by coverity. >
> Fixes:d33b68154fa4("net/bnxt: addtf_coretable scope support")The commit id and the patch title doesn't exist in next-net (also not int next-net-brcm), I guess you mean [1] but the updated function below ('
tf_em_ctx_reg()') even not exist in that commit.
Quoted 6 lines
Can you please check the tag again?
[1] net/bnxt: support TruFlow core table scope
Yes [1] is the correct commit.
dba3ca8b304f("net/bnxt: support TruFlow core table scope").
Using following after offline discussion:
Quoted 31 lines
Quoted 3 lines
Coverity issue: 357771
Signed-off-by Ajit Khaparde <[email protected]<mailto:[email protected]>> > Reviewed-by: Somnath Kotur <[email protected] <mailto:[email protected]>> > Reviewed-by: Randy Schacher <[email protected] <mailto:[email protected]>> > --- > drivers/net/bnxt/tf_core/tf_tbl.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/bnxt/tf_core/tf_tbl.c b/drivers/net/bnxt/tf_core/tf_tbl.c > index 93f387e86..d900c9c09 100644 > --- a/drivers/net/bnxt/tf_core/tf_tbl.c > +++ b/drivers/net/bnxt/tf_core/tf_tbl.c > @@ -539,7 +539,7 @@ tf_em_ctx_reg(struct tf *tfp, > { > struct tf_em_ctx_mem_info *ctxp = &tbl_scope_cb->em_ctx_info[dir]; > struct tf_em_table *tbl; > - int rc; > + int rc = 0; > int i; > > for (i = KEY0_TABLE; i < MAX_TABLE; i++) { >
Quoted 3 lines · Ajit Khaparde
Fix issues reported by Coverity.
Note that one issue was reported in internal coverity scan.
Patches applied to dpdk-next-net-brcm.
Quoted 15 lines
Ajit Khaparde (1):
net/bnxt: fix uninitialized variable errorKishore Padmanabha (1):
net/bnxt: fix overrun of the ulp device params arraydrivers/net/bnxt/tf_core/tf_tbl.c | 2 +- drivers/net/bnxt/tf_ulp/ulp_template_db.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)--
2.21.1 (Apple Git-122.3)
v2 cover fix coverity reported issues
In reply to Ajit KhapardeFix issues reported by Coverity.
Note that one issue addressed by patch [1/2] was reported in internal coverity scan.
v1->v2: mention that one of the issue was reported in internal scan.
Ajit Khaparde (1):
net/bnxt: fix uninitialized variable error
Kishore Padmanabha (1):
net/bnxt: fix overrun of the ulp device params array
drivers/net/bnxt/tf_core/tf_tbl.c | 2 +- drivers/net/bnxt/tf_ulp/ulp_template_db.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
Signature · 1 line
2.21.1 (Apple Git-122.3)
PATCH v2 1/2 net/bnxt: fix overrun of the ulp device params array
From: Kishore Padmanabha <[email protected]>
Fix a buffer overrun issue spotted by coverity while accessing the array ulp_device_params.
Note that the issue was observed in an internal Coverity scan.
--- drivers/net/bnxt/tf_ulp/ulp_template_db.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/bnxt/tf_ulp/ulp_template_db.c +1 -1
@@ -321,7 +321,7 @@ struct bnxt_ulp_def_ident_info ulp_def_ident_tbl[] = { } }; -struct bnxt_ulp_device_params ulp_device_params[] = { +struct bnxt_ulp_device_params ulp_device_params[BNXT_ULP_DEVICE_ID_LAST ] = { [BNXT_ULP_DEVICE_ID_WH_PLUS ] = { .global_fid_enable =BNXT_ULP_SYM_YES , .byte_order = (enum bnxt_ulp_byte_order)
Signature · 1 line
2.21.1 (Apple Git-122.3)
PATCH v2 2/2 net/bnxt: fix uninitialized variable error
In reply to Ajit KhapardeFix uninitialized variable error reported by coverity.
Coverity issue: 357771
--- drivers/net/bnxt/tf_core/tf_tbl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/bnxt/tf_core/tf_tbl.c +1 -1
@@ -539,7 +539,7 @@ tf_em_ctx_reg(struct tf *tfp, {struct tf_em_ctx_mem_info *ctxp = &tbl_scope_cb->em_ctx_info[dir];struct tf_em_table *tbl; -int rc; +int rc =0 ;int i;for (i =KEY0_TABLE ; i <MAX_TABLE ; i++) {
Signature · 1 line
2.21.1 (Apple Git-122.3)