net/bnxt: fix missed unlock reported by coverity
Checks
Commit Message
From: Yunjian Wang <wangyunjian@huawei.com>
Coverity issue: 357741
Fixes: 02a95625fe9c ("net/bnxt: add flow stats in extended stats")
Cc: stable@dpdk.org
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
---
drivers/net/bnxt/bnxt_stats.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
Comments
On Wed, May 27, 2020 at 5:42 PM wangyunjian <wangyunjian@huawei.com> wrote:
>
> From: Yunjian Wang <wangyunjian@huawei.com>
>
> Coverity issue: 357741
> Fixes: 02a95625fe9c ("net/bnxt: add flow stats in extended stats")
> Cc: stable@dpdk.org
>
> Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
> ---
> drivers/net/bnxt/bnxt_stats.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/bnxt/bnxt_stats.c b/drivers/net/bnxt/bnxt_stats.c
> index cfe193284..8df6922f5 100644
> --- a/drivers/net/bnxt/bnxt_stats.c
> +++ b/drivers/net/bnxt/bnxt_stats.c
> @@ -1008,8 +1008,10 @@ int bnxt_flow_stats_req(struct bnxt *bp)
> }
> }
>
> - if (!in_flow_tbl_cnt)
> + if (!in_flow_tbl_cnt) {
> + bnxt_release_flow_lock(bp);
> goto out;
> + }
>
> rc = bnxt_update_fc_tbl(bp, counter_type, valid_en_tbl,
> in_flow_tbl_cnt);
> --
> 2.23.0
>
>
Acked-by: Somnath Kotur <somnath.kotur@broadcom.com>
On Wed, May 27, 2020 at 5:13 AM Somnath Kotur <somnath.kotur@broadcom.com>
wrote:
> On Wed, May 27, 2020 at 5:42 PM wangyunjian <wangyunjian@huawei.com>
> wrote:
> >
> > From: Yunjian Wang <wangyunjian@huawei.com>
> >
> > Coverity issue: 357741
> > Fixes: 02a95625fe9c ("net/bnxt: add flow stats in extended stats")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
>
Patch applied to dpdk-next-net-brcm. Thanks
> > ---
> > drivers/net/bnxt/bnxt_stats.c | 4 +++-
> > 1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/bnxt/bnxt_stats.c
> b/drivers/net/bnxt/bnxt_stats.c
> > index cfe193284..8df6922f5 100644
> > --- a/drivers/net/bnxt/bnxt_stats.c
> > +++ b/drivers/net/bnxt/bnxt_stats.c
> > @@ -1008,8 +1008,10 @@ int bnxt_flow_stats_req(struct bnxt *bp)
> > }
> > }
> >
> > - if (!in_flow_tbl_cnt)
> > + if (!in_flow_tbl_cnt) {
> > + bnxt_release_flow_lock(bp);
> > goto out;
> > + }
> >
> > rc = bnxt_update_fc_tbl(bp, counter_type, valid_en_tbl,
> > in_flow_tbl_cnt);
> > --
> > 2.23.0
> >
> >
> Acked-by: Somnath Kotur <somnath.kotur@broadcom.com>
>
@@ -1008,8 +1008,10 @@ int bnxt_flow_stats_req(struct bnxt *bp)
}
}
- if (!in_flow_tbl_cnt)
+ if (!in_flow_tbl_cnt) {
+ bnxt_release_flow_lock(bp);
goto out;
+ }
rc = bnxt_update_fc_tbl(bp, counter_type, valid_en_tbl,
in_flow_tbl_cnt);