]> git.droids-corp.org - dpdk.git/commitdiff
common/cnxk: add null check for inline device
authorVolodymyr Fialko <vfialko@marvell.com>
Mon, 28 Mar 2022 10:41:02 +0000 (12:41 +0200)
committerJerin Jacob <jerinj@marvell.com>
Mon, 2 May 2022 17:42:38 +0000 (19:42 +0200)
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 <vfialko@marvell.com>
drivers/common/cnxk/roc_nix_inl.c

index 826c6e99c1e7c9cf00d0df93982ea77355f7ac76..569b7f6da241559572e9c26b48c67b1cb7a5e903 100644 (file)
@@ -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;