From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3923FA04FD for ; Mon, 28 Mar 2022 12:41:20 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2F183427F4; Mon, 28 Mar 2022 12:41:20 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 409A141104; Mon, 28 Mar 2022 12:41:18 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 22SA4cc8011177; Mon, 28 Mar 2022 03:41:17 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=zUil36n5BuSR9x64kY6ZwJY9Ej5yA5Jjz0rEZNoalNA=; b=JWb84On6a0GKF+ibbAIugZKVHlRqqdo3ZsQ2OFiN+oYi86WY1ppix/aTjh3W985pfpCx vr1kR+5PJ25lz+1uyrfxbeanKJRogXZuN412xZjal7I6znN055NfPsB0xxmq+qFeFHsI HoeHn3p6E+YAQBk/6UQcbpiuiQTs2RzViXwagiGUIvF/+x4vM1E38I7wfS+c54k7zsiT 6+M430hL6AddOYE7AZEdNq0o9wMzaTnJgCzx6aCZPkddl27QUXjxnaUXa5At6/afCtnr Wc9ibjXYRDKQOgAi9Kmlsi7VK6jEewsMcgxcIWoS4rF8Bxg6HINohyn60IWlSiAhJxKb Kw== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3f206p6mpw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Mon, 28 Mar 2022 03:41:17 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Mon, 28 Mar 2022 03:41:15 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Mon, 28 Mar 2022 03:41:15 -0700 Received: from localhost.localdomain (unknown [10.28.34.39]) by maili.marvell.com (Postfix) with ESMTP id 4AE153F7061; Mon, 28 Mar 2022 03:41:13 -0700 (PDT) From: Volodymyr Fialko To: , Nithin Dabilpuram , Kiran Kumar K , Sunil Kumar Kori , Satha Rao CC: , Volodymyr Fialko , Subject: [PATCH] common/cnxk: fix missing null check for inline device Date: Mon, 28 Mar 2022 12:41:02 +0200 Message-ID: <20220328104102.2292890-1-vfialko@marvell.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: Eh3OUOdG-xF5IXAGmSteZ5RvJyuggjS8 X-Proofpoint-ORIG-GUID: Eh3OUOdG-xF5IXAGmSteZ5RvJyuggjS8 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.850,Hydra:6.0.425,FMLib:17.11.64.514 definitions=2022-03-28_03,2022-03-28_01,2022-02-23_01 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org 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 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