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 289AFA034D; Fri, 28 Jan 2022 09:50:59 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D39A24281C; Fri, 28 Jan 2022 09:50:58 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id 45C6640141 for ; Fri, 28 Jan 2022 09:50:57 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1643359857; x=1674895857; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=j+icz42fdj7cXZWwmqYh6OuNFsCa+vBZN926FXtDCvk=; b=JdbDSW4G++LDonEDoqZEnijv/iTewG3oD1RmMCWwk93/r3DVzWVXfWfs Jsn6JpFyCesN5xHsU0Sfr2MU52IVzgwzyv8V5MFuhXO+I8KgnUpzjZLCL ldt7yNS3xZLK9lqyWyp6/oR0lE+yOh7sxLUJ1obErZDSqxuOalDTnh3NH +xgBEZyZa4FQzep8mL8xiLIFOgzXleo+x6D+EVslOh3tTSyztfZvST8kk IA/ImKCcZNlxlKIVF4opw70qdgQmmLuxrdMWgsz1nYPlxu7z4Yxf+r+mh P4QCL7c65vsNuVXqNgESKaD+fCCCnKLATGqqnl5hVjI09mZy7Hj6OERyE g==; X-IronPort-AV: E=McAfee;i="6200,9189,10240"; a="271540627" X-IronPort-AV: E=Sophos;i="5.88,323,1635231600"; d="scan'208";a="271540627" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jan 2022 00:50:56 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,323,1635231600"; d="scan'208";a="697026247" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by orsmga005.jf.intel.com with ESMTP; 28 Jan 2022 00:50:56 -0800 Received: from shsmsx604.ccr.corp.intel.com (10.109.6.214) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Fri, 28 Jan 2022 00:50:55 -0800 Received: from shsmsx601.ccr.corp.intel.com (10.109.6.141) by SHSMSX604.ccr.corp.intel.com (10.109.6.214) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Fri, 28 Jan 2022 16:50:53 +0800 Received: from shsmsx601.ccr.corp.intel.com ([10.109.6.141]) by SHSMSX601.ccr.corp.intel.com ([10.109.6.141]) with mapi id 15.01.2308.020; Fri, 28 Jan 2022 16:50:53 +0800 From: "Zhang, Qi Z" To: Weiguo Li , "Wu, Jingjing" CC: "Nicolau, Radu" , "dev@dpdk.org" Subject: RE: [PATCH] net/iavf: fix null pointer dereference Thread-Topic: [PATCH] net/iavf: fix null pointer dereference Thread-Index: AQHYEfcnNfvl+HVb50KKMmKjJ07L46x4I5Tw Date: Fri, 28 Jan 2022 08:50:53 +0000 Message-ID: <6bed1ee37d76474bbf2a54218734e70a@intel.com> References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-reaction: no-action dlp-version: 11.6.200.16 dlp-product: dlpe-windows x-originating-ip: [10.239.127.36] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org > -----Original Message----- > From: Weiguo Li > Sent: Tuesday, January 25, 2022 10:23 PM > To: Wu, Jingjing > Cc: Nicolau, Radu ; dev@dpdk.org > Subject: [PATCH] net/iavf: fix null pointer dereference >=20 > Check for memory allocation failure is added to avoid null pointer > dereference. >=20 > Fixes: 6bc987ecb860 ("net/iavf: support IPsec inline crypto") >=20 > Signed-off-by: Weiguo Li > --- > drivers/net/iavf/iavf_ipsec_crypto.c | 2 ++ > 1 file changed, 2 insertions(+) >=20 > diff --git a/drivers/net/iavf/iavf_ipsec_crypto.c > b/drivers/net/iavf/iavf_ipsec_crypto.c > index adf101ab8a..ac67aa28f7 100644 > --- a/drivers/net/iavf/iavf_ipsec_crypto.c > +++ b/drivers/net/iavf/iavf_ipsec_crypto.c > @@ -1352,6 +1352,8 @@ iavf_ipsec_crypto_set_security_capabililites(struct > iavf_security_ctx > capabilities =3D rte_zmalloc("crypto_cap", > sizeof(struct rte_cryptodev_capabilities) * > (number_of_capabilities + 1), 0); > + if (!capabilities) > + return (-ENOMEM); Better to unwrap the bracket to keep coding style consistent=20 > capabilities[number_of_capabilities].op =3D > RTE_CRYPTO_OP_TYPE_UNDEFINED; >=20 > /** > -- > 2.25.1