[PATCH] common/cnxk: fix missing null check for inline device

Volodymyr Fialko vfialko at marvell.com
Mon Mar 28 12:41:02 CEST 2022


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 at dpdk.org

Signed-off-by: Volodymyr Fialko <vfialko at marvell.com>
---
 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 877a9f1aa8..d0a38d2d4d 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.25.1



More information about the stable mailing list