From 7ae43d883d77c51ab00e4869329803107b9f2425 Mon Sep 17 00:00:00 2001 From: Volodymyr Fialko Date: Mon, 28 Mar 2022 12:41:02 +0200 Subject: [PATCH] common/cnxk: add null check for inline device Inline device could be null in cases when it was not bound or missing. Added check to prevent null pointer access. Fixes: fe5846bcc07 ("net/cnxk: add devargs for min-max SPI") Cc: stable@dpdk.org Signed-off-by: Volodymyr Fialko --- drivers/common/cnxk/roc_nix_inl.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/common/cnxk/roc_nix_inl.c b/drivers/common/cnxk/roc_nix_inl.c index 826c6e99c1..569b7f6da2 100644 --- a/drivers/common/cnxk/roc_nix_inl.c +++ b/drivers/common/cnxk/roc_nix_inl.c @@ -158,6 +158,8 @@ roc_nix_inl_inb_spi_range(struct roc_nix *roc_nix, bool inb_inl_dev, inl_dev = idev->nix_inl_dev; if (inb_inl_dev) { + if (inl_dev == NULL) + goto exit; min = inl_dev->ipsec_in_min_spi; max = inl_dev->ipsec_in_max_spi; mask = inl_dev->inb_spi_mask; -- 2.39.5