net/bnxt: check access to possible null pointer
Check that pointers are valid before using them.
Fixes: 7bc8e9a227
("net/bnxt: support async link notification")
Cc: stable@dpdk.org
Signed-off-by: Thierry Herbelot <thierry.herbelot@6wind.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
This commit is contained in:
parent
2ca92f5441
commit
dc59260fb6
@ -21,11 +21,14 @@ void bnxt_int_handler(void *param)
|
|||||||
{
|
{
|
||||||
struct rte_eth_dev *eth_dev = (struct rte_eth_dev *)param;
|
struct rte_eth_dev *eth_dev = (struct rte_eth_dev *)param;
|
||||||
struct bnxt *bp = eth_dev->data->dev_private;
|
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;
|
struct cmpl_base *cmp;
|
||||||
uint32_t raw_cons;
|
uint32_t raw_cons;
|
||||||
uint32_t cons;
|
uint32_t cons;
|
||||||
|
|
||||||
|
if (bp == NULL)
|
||||||
|
return;
|
||||||
|
cpr = bp->async_cp_ring;
|
||||||
if (cpr == NULL)
|
if (cpr == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user