net/bnxt: fix initialization of filter struct
Checks
Commit Message
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
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.
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.
@@ -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;
}