Skip to content

Commit

Permalink
net/bnxt: check access to possible null pointer
Browse files Browse the repository at this point in the history
[ upstream commit dc59260 ]

Check that pointers are valid before using them.

Fixes: 7bc8e9a ("net/bnxt: support async link notification")

Signed-off-by: Thierry Herbelot <thierry.herbelot@6wind.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
  • Loading branch information
herbelot authored and cpaelzer committed Aug 9, 2021
1 parent c7fc079 commit 839b753
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/net/bnxt/bnxt_irq.c
Expand Up @@ -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;

Expand Down

0 comments on commit 839b753

Please sign in to comment.