patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH] net/bnxt: do not use possibly NULL pointers
@ 2021-05-24  9:00 Thierry Herbelot
  2021-06-07 21:17 ` Ajit Khaparde
  0 siblings, 1 reply; 2+ messages in thread
From: Thierry Herbelot @ 2021-05-24  9:00 UTC (permalink / raw)
  To: dev
  Cc: Thierry Herbelot, Thomas Monjalon, stable, Ajit Khaparde, Somnath Kotur

Check that pointers are valid before using them.

Fixes: 7bc8e9a227ccb ("net/bnxt: support async link notification")
Cc: stable@dpdk.org
Cc: Ajit Khaparde <ajit.khaparde@broadcom.com>
Cc: Somnath Kotur <somnath.kotur@broadcom.com>

Signed-off-by: Thierry Herbelot <thierry.herbelot@6wind.com>
---
 drivers/net/bnxt/bnxt_irq.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/bnxt/bnxt_irq.c b/drivers/net/bnxt/bnxt_irq.c
index 8abbadb3d19d..fd8b8fac989a 100644
--- a/drivers/net/bnxt/bnxt_irq.c
+++ b/drivers/net/bnxt/bnxt_irq.c
@@ -21,11 +21,14 @@ void bnxt_int_handler(void *param)
 {
 	struct rte_eth_dev *eth_dev = (struct rte_eth_dev *)param;
 	struct bnxt *bp = eth_dev->data->dev_private;
-	struct bnxt_cp_ring_info *cpr = bp->async_cp_ring;
+	struct bnxt_cp_ring_info *cpr;
 	struct cmpl_base *cmp;
 	uint32_t raw_cons;
 	uint32_t cons;
 
+	if (bp == NULL)
+		return;
+	cpr = bp->async_cp_ring;
 	if (cpr == NULL)
 		return;
 
-- 
2.29.2


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-stable] [PATCH] net/bnxt: do not use possibly NULL pointers
  2021-05-24  9:00 [dpdk-stable] [PATCH] net/bnxt: do not use possibly NULL pointers Thierry Herbelot
@ 2021-06-07 21:17 ` Ajit Khaparde
  0 siblings, 0 replies; 2+ messages in thread
From: Ajit Khaparde @ 2021-06-07 21:17 UTC (permalink / raw)
  To: Thierry Herbelot; +Cc: dpdk-dev, Thomas Monjalon, dpdk stable, Somnath Kotur

[-- Attachment #1: Type: text/plain, Size: 1310 bytes --]

On Mon, May 24, 2021 at 2:00 AM Thierry Herbelot
<thierry.herbelot@6wind.com> wrote:
>
> Check that pointers are valid before using them.
>
> Fixes: 7bc8e9a227ccb ("net/bnxt: support async link notification")
> Cc: stable@dpdk.org
> Cc: Ajit Khaparde <ajit.khaparde@broadcom.com>
> Cc: Somnath Kotur <somnath.kotur@broadcom.com>
>
> Signed-off-by: Thierry Herbelot <thierry.herbelot@6wind.com>

Modified the commit headline and applied to
dpdk-next-net-brcm/for-next-net branch.

Thanks

> ---
>  drivers/net/bnxt/bnxt_irq.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/bnxt/bnxt_irq.c b/drivers/net/bnxt/bnxt_irq.c
> index 8abbadb3d19d..fd8b8fac989a 100644
> --- a/drivers/net/bnxt/bnxt_irq.c
> +++ b/drivers/net/bnxt/bnxt_irq.c
> @@ -21,11 +21,14 @@ void bnxt_int_handler(void *param)
>  {
>         struct rte_eth_dev *eth_dev = (struct rte_eth_dev *)param;
>         struct bnxt *bp = eth_dev->data->dev_private;
> -       struct bnxt_cp_ring_info *cpr = bp->async_cp_ring;
> +       struct bnxt_cp_ring_info *cpr;
>         struct cmpl_base *cmp;
>         uint32_t raw_cons;
>         uint32_t cons;
>
> +       if (bp == NULL)
> +               return;
> +       cpr = bp->async_cp_ring;
>         if (cpr == NULL)
>                 return;
>
> --
> 2.29.2
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-06-07 21:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-24  9:00 [dpdk-stable] [PATCH] net/bnxt: do not use possibly NULL pointers Thierry Herbelot
2021-06-07 21:17 ` Ajit Khaparde

patches for DPDK stable branches

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ https://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git