diff mbox series

net/bnxt: fix initialization of filter struct

Message ID 20210428220403.10115-1-lance.richardson@broadcom.com (mailing list archive)
State Not Applicable, archived
Delegated to: Ajit Khaparde
Headers show
Series net/bnxt: fix initialization of filter struct | expand

Checks

Context Check Description
ci/intel-Testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-mellanox-Performance success Performance Testing PASS
ci/github-robot success github build: passed
ci/iol-abi-testing success Testing PASS
ci/iol-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/checkpatch success coding style OK

Commit Message

Lance Richardson April 28, 2021, 10:04 p.m. UTC
Initialize filter structure to all zeroes on allocation.

Fixes: 5ef3b79fdfe6 ("net/bnxt: support flow filter ops")
Cc: stable@dpdk.org
Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Kumar Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_filter.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Lance Richardson April 29, 2021, 1:43 p.m. UTC | #1
On Wed, Apr 28, 2021 at 6:04 PM Lance Richardson
<lance.richardson@broadcom.com> wrote:
>
> Initialize filter structure to all zeroes on allocation.
>
> Fixes: 5ef3b79fdfe6 ("net/bnxt: support flow filter ops")
> Cc: stable@dpdk.org
> Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
> Reviewed-by: Ajit Kumar Khaparde <ajit.khaparde@broadcom.com>
> ---
>  drivers/net/bnxt/bnxt_filter.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/bnxt/bnxt_filter.c b/drivers/net/bnxt/bnxt_filter.c
> index 1d08e03b2f..6aadfa9526 100644
> --- a/drivers/net/bnxt/bnxt_filter.c
> +++ b/drivers/net/bnxt/bnxt_filter.c
> @@ -188,6 +188,7 @@ struct bnxt_filter_info *bnxt_get_unused_filter(struct bnxt *bp)
>                 return NULL;
>         }
>         STAILQ_REMOVE_HEAD(&bp->free_filter_list, next);
> +       memset(filter, 0, sizeof(*filter));
>
>         return filter;
>  }
> --
> 2.25.1
>
Self-NAK, will send a v2 shortly.
Lance Richardson April 29, 2021, 1:59 p.m. UTC | #2
On Thu, Apr 29, 2021 at 9:43 AM Lance Richardson
<lance.richardson@broadcom.com> wrote:
>
> On Wed, Apr 28, 2021 at 6:04 PM Lance Richardson
> <lance.richardson@broadcom.com> wrote:
> >
> > Initialize filter structure to all zeroes on allocation.
> >
> > Fixes: 5ef3b79fdfe6 ("net/bnxt: support flow filter ops")
> > Cc: stable@dpdk.org
> > Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
> > Reviewed-by: Ajit Kumar Khaparde <ajit.khaparde@broadcom.com>
> > ---
> >  drivers/net/bnxt/bnxt_filter.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/net/bnxt/bnxt_filter.c b/drivers/net/bnxt/bnxt_filter.c
> > index 1d08e03b2f..6aadfa9526 100644
> > --- a/drivers/net/bnxt/bnxt_filter.c
> > +++ b/drivers/net/bnxt/bnxt_filter.c
> > @@ -188,6 +188,7 @@ struct bnxt_filter_info *bnxt_get_unused_filter(struct bnxt *bp)
> >                 return NULL;
> >         }
> >         STAILQ_REMOVE_HEAD(&bp->free_filter_list, next);
> > +       memset(filter, 0, sizeof(*filter));
> >
> >         return filter;
> >  }
> > --
> > 2.25.1
> >
> Self-NAK, will send a v2 shortly.

Let's drop this patch, this is already fixed in upstream via
commit 7105de7085b0 ("net/bnxt: reset filter indices on free"),
but that commit should be applied to -stable branches.
diff mbox series

Patch

diff --git a/drivers/net/bnxt/bnxt_filter.c b/drivers/net/bnxt/bnxt_filter.c
index 1d08e03b2f..6aadfa9526 100644
--- a/drivers/net/bnxt/bnxt_filter.c
+++ b/drivers/net/bnxt/bnxt_filter.c
@@ -188,6 +188,7 @@  struct bnxt_filter_info *bnxt_get_unused_filter(struct bnxt *bp)
 		return NULL;
 	}
 	STAILQ_REMOVE_HEAD(&bp->free_filter_list, next);
+	memset(filter, 0, sizeof(*filter));
 
 	return filter;
 }