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 99C45A0547; Mon, 24 May 2021 13:28:10 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5987B4003E; Mon, 24 May 2021 13:28:10 +0200 (CEST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id 085C84003C; Mon, 24 May 2021 13:28:08 +0200 (CEST) IronPort-SDR: 7Sba6LQUEMS/oSAlUQ4xcuONk0nmob9DI7+dfmpiEWrDXwTyAYhha2uCmEVzPuReHzeaAMjcbD i+ILrUTgO5Ag== X-IronPort-AV: E=McAfee;i="6200,9189,9993"; a="263122205" X-IronPort-AV: E=Sophos;i="5.82,319,1613462400"; d="scan'208";a="263122205" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 May 2021 04:28:06 -0700 IronPort-SDR: +leKNp9hvC2ik71iVxQylJvmqcZpX6dqS5R3x9+4Km2dcAe40juj4AkVzkSmQyByyXAnNB5ltW wimavwbVCTIg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,319,1613462400"; d="scan'208";a="475825756" Received: from fmsmsx604.amr.corp.intel.com ([10.18.126.84]) by orsmga001.jf.intel.com with ESMTP; 24 May 2021 04:28:06 -0700 Received: from fmsmsx609.amr.corp.intel.com (10.18.126.89) by fmsmsx604.amr.corp.intel.com (10.18.126.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.4; Mon, 24 May 2021 04:28:06 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx609.amr.corp.intel.com (10.18.126.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.4 via Frontend Transport; Mon, 24 May 2021 04:28:06 -0700 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (104.47.73.45) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.4; Mon, 24 May 2021 04:28:06 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Xl4jCv5Wi9bvdXukCKImTy0pZJmCs4DiAX7Qlv63vTiZOfZAP/CnJmUh1xNZ+xaRtdlNmYu1oFRlb088n/BYg599KIpZ42hSpxufOg1BMu4DhQW6ABfa6uGNqj5Ey1BEvPFF3YHxmr6vtz5cuhuqLqYonan2Br/dNRzVOyLga2t4atYRqFsi7j/bdqK7+ArM71SS8idKf56us18MEa+nwYZqrAP7cgYZxHeFaaM7tLGQrka6FgrDwltS9eVDWzNYZQBTX6+L9h5E99ARuf/zxEgsnZfMgDISvYbMdLVaSBv300Sw4LA6wcJhjdcFELk8madFIBP6O98a1hdD6zBPyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=AH1LLW1dz6XS6t7XMpnMxExUyD3SkA73nckVsYr/3Y8=; b=ji7W8jAJycLZA3pK5+0Uw2hBpkmhbURqeKE/33AlBqusd5IuwoG/2eYnw7LsuPgfGU22SzsrmCZ16buoVKImDo9MI/o/kvDA5vggIlOFoKS8pB/A31f4y6+O3Ok+ODDC4FbNfQOYi1PsgvC2n0bdUoeFwRzJPi1fNee3uGfQ1tiT7JC0Q9dUvmaaX4EvbiZu/GombKWbzmd72/jQSEcXYIEVKtpK8i0z5jwo42vRE6/fJ+vvTAY5H8vNYmcJ49nLfZJZN8/nrMs5+V3Y1p219+Ed7pgBUlXmAjzrXMWrx5GyZaW+Yf1gFmf6cym82A+SEV/7P5QkZHDG7iVHRB29Yg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=AH1LLW1dz6XS6t7XMpnMxExUyD3SkA73nckVsYr/3Y8=; b=OgtcdQcdyLs/qyZSAteKxwKubNcI2SM5/jNY2yuFp/QWPujvp1j9yfKhnb5o9GHxYUndd1pRs1k6V4VSswNuk5BgXvsRBouWiAY7ma63ue9hZKM3sXQg+sGtGHP2Haj5FtV+3KuPJIWUza2MoqtnfOgEGyB/he+L9Amh3u/B3z4= Received: from DM6PR11MB2796.namprd11.prod.outlook.com (2603:10b6:5:c8::23) by DM6PR11MB2553.namprd11.prod.outlook.com (2603:10b6:5:bf::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.23; Mon, 24 May 2021 11:28:05 +0000 Received: from DM6PR11MB2796.namprd11.prod.outlook.com ([fe80::d099:834d:f5ad:39c9]) by DM6PR11MB2796.namprd11.prod.outlook.com ([fe80::d099:834d:f5ad:39c9%3]) with mapi id 15.20.4150.027; Mon, 24 May 2021 11:28:05 +0000 From: "Dumitrescu, Cristian" To: Thierry Herbelot , "dev@dpdk.org" CC: Thomas Monjalon , "stable@dpdk.org" , "Singh, Jasvinder" Thread-Topic: [PATCH] rte_sched: check newly allocated pointer Thread-Index: AQHXUHrnQBn1DrSbJUaxAP8qXx1ymqryfkQg Date: Mon, 24 May 2021 11:28:05 +0000 Message-ID: References: <20210524085737.15717-1-thierry.herbelot@6wind.com> In-Reply-To: <20210524085737.15717-1-thierry.herbelot@6wind.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.5.1.3 dlp-reaction: no-action dlp-product: dlpe-windows authentication-results: 6wind.com; dkim=none (message not signed) header.d=none;6wind.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [64.43.28.196] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 4bf9df44-d132-402f-f141-08d91ea6ffbf x-ms-traffictypediagnostic: DM6PR11MB2553: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:5516; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: k6iVhCg+vxfs9RMTen/8ulHDoVbHGxCPRd4zgQL2dqsBji4rAlVdwU9SerCwtyGx6bD1d3vP1yQuFI2uejxp1FphyAK7FCO0YFrCWsBNYYXy6czUY/K390uFa8Y3x7y5bIIjvv6bZ27Sha52ThymtsQdq80jTIJiHCDhSg2Y95KcfNpbn4yot0rTCgFDAuz7BJluUpJ03jpVQldctWsVLIiSlbPmMEaWKrA5ug5XFeypK0p6naBwz3zU29QmKG6DIHlHFTy8o8VnMIN0tq7+mQuhaY12I32n3TMw/qfjXb6FC/Z7AEJTDpaQLVuPcz/oteSZdOgXseAYrF258OzBJpBeST9AK6sqh1CzSBWZVCv1cdPfA6z9cD8oLptSNV8ieg1/DNzf9lVTXAdY2bNiodvqRJnlfl23fWaVXGvZuLzz5ZmAVbrKgYTOaUmgzdhHTrLHIHM576W2jm4NDv88M7JMPQSUd5RosVAACm+6vLrSkdVX0QkNiWRIn65VwuaYHG1EgxYBXmiadbWQYIHzyH18W/xZU98CjMiamnVqOyRGPJJ+DvmOnAkZTi5xPymRdr3342jXEIFuklh5rOQxQhZ8aTf14dJkONJdX/WDrZE= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR11MB2796.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(39860400002)(396003)(376002)(366004)(346002)(136003)(8676002)(76116006)(55016002)(52536014)(5660300002)(316002)(66476007)(9686003)(66556008)(8936002)(86362001)(66446008)(64756008)(110136005)(71200400001)(54906003)(2906002)(66946007)(53546011)(4326008)(6506007)(186003)(478600001)(26005)(83380400001)(107886003)(33656002)(122000001)(7696005)(38100700002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?slvxVgMyFgCZJpgHmbqbZLosNlDYQ2NlfuH13RucKiH6I/z9z5f0aoNhjeF1?= =?us-ascii?Q?X7HjU4g/2P7vINvDM1dDEiMLwi9NvYz+Gm0oF6UmZlcWCqeY+W74qCUgjw0g?= =?us-ascii?Q?z0D7p4y8agilIZmi7uJGHNLqRZlUFU6sHMT/jUOaRokU91lMNewAgFr+cQmu?= =?us-ascii?Q?4wB57ukqklgMwSLORECeyV5RLJud4Eotr+u3184ihkenTd29Q1kFIKVjLp1n?= =?us-ascii?Q?qP70NNDL7GeyO4n1wp/SGNeogfGrruxZ5r/7Jdxhs9uDV9op0kq65nOKjlxh?= =?us-ascii?Q?wIZeRS7EnWYOxfJ/CEo4yd4Yva0EdIDz2QGkvDIyF3hcI+YWKAdEG4AQ3mWI?= =?us-ascii?Q?YbAivc1nubSlkUN0+FMUxpQnwRHPp8sQJC9vB2/vPEQJyXhd0WVbquF7wYxm?= =?us-ascii?Q?YYnhFPZoYSnuRvK8Tmb3hxiAulh48iAlSYWhz7Y9gYlhXBnD6rNClbszTDWW?= =?us-ascii?Q?noLtHt8fKt3NjpCGX+nuS+A6gzigMftm9qP1FTvvBdcfg+a8gKLMghdY5Fr3?= =?us-ascii?Q?C6iDkvmarWyeiLG8EqldMrpjL8EkL0/9/yn0Nu62raD69ARN41umuR8eWpsq?= =?us-ascii?Q?TQ+qJgF/CQ9B6pauC6xxdoVqaWMekWIMGZW3NkLvqaLa2AmEV2RNnnbKszY9?= =?us-ascii?Q?NyH/svqBbH8h4+3Bfd9pNIuzPdtfcrtwazOxawin2XcuCqjfOtN3p+dtHyKy?= =?us-ascii?Q?q67l0Mr5gJRJJapgjNsp42kMAgER050dXtE4fXDVaKsVwD5uYggMLuIKo/z8?= =?us-ascii?Q?5juS7G2npAy5m2DV8H8EEl+Zt1Xj2PxZ3ETHE2/S8Q+lRwo50x5Za7fvD9aa?= =?us-ascii?Q?NBjZP0z8piWJqi5vyuwy8XvVymx/TTXPDaT/b77TJ3p+krJQvfrZVjU4erBt?= =?us-ascii?Q?tgYfHHiOQ1HktZKUgP+UWd1EjfRsNu+WDqiaXYUwJf3IoistMpP08lRu3xgE?= =?us-ascii?Q?HU2MVSlLND4aiczG7v9r3Kf/kdQJiaIv/OYAKGqRbMVtnExZRS7JHvKevCMw?= =?us-ascii?Q?V9E6sbFB7ZUtbm3OJ3+WxSyVwAbZ0dvl7Ti2C2aqCb6Y7oamhUTEzU/pK6Cb?= =?us-ascii?Q?JvxnDlkHc5nSdXvr0M7CkCnJhoYCIpDCiFU22MVpS+qRjg7raucPwU7xRfwQ?= =?us-ascii?Q?VwglEAnpsYZvCQj8i0pDrYQhnQXdKrA2hNV8jmFXnkoZGyx7ALyVEpbkYquT?= =?us-ascii?Q?w3+jMNrSHitWyJZaQoJE1u0RDEaEFVxgwzXbbdccbSyNV5UxpSvUT6jLtPRN?= =?us-ascii?Q?bMkAZK1mPz7mKfK1BSHOSp3WbbSM2xFKZPBeKl+cT08doxhvfrvEF8m+ZI0q?= =?us-ascii?Q?vZs=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB2796.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4bf9df44-d132-402f-f141-08d91ea6ffbf X-MS-Exchange-CrossTenant-originalarrivaltime: 24 May 2021 11:28:05.3429 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 5/54R49rCAllbLsMsnw5CBtqciZW4RmWr85dAxaGm80pMK9WP34z9aa/hLKRnviQ932juef7cLKYQrJP1xhx9iGAP+R3TMmPqyJA3ds44gU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB2553 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH] rte_sched: check newly allocated pointer 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 Sender: "dev" > -----Original Message----- > From: Thierry Herbelot > Sent: Monday, May 24, 2021 9:58 AM > To: dev@dpdk.org > Cc: Thierry Herbelot ; Thomas Monjalon > ; stable@dpdk.org; Dumitrescu, Cristian > ; Singh, Jasvinder > > Subject: [PATCH] rte_sched: check newly allocated pointer >=20 > Check port->subport_profiles after it was allocated. >=20 > Fixes: 0ea4c6afcaf14 ("sched: add subport profile table") > Cc: stable@dpdk.org > Cc: Cristian Dumitrescu > Cc: Jasvinder Singh >=20 > Signed-off-by: Thierry Herbelot > --- > lib/sched/rte_sched.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/lib/sched/rte_sched.c b/lib/sched/rte_sched.c > index cd87e688e489..4a2c0e27550d 100644 > --- a/lib/sched/rte_sched.c > +++ b/lib/sched/rte_sched.c > @@ -961,7 +961,7 @@ rte_sched_port_config(struct > rte_sched_port_params *params) > /* Allocate memory to store the subport profile */ > port->subport_profiles =3D rte_zmalloc_socket("subport_profile", > size2, > RTE_CACHE_LINE_SIZE, params- > >socket); > - if (port =3D=3D NULL) { > + if (port->subport_profiles =3D=3D NULL) { > RTE_LOG(ERR, SCHED, "%s: Memory allocation fails\n", > __func__); >=20 > return NULL; > -- > 2.29.2 Acked-by: Cristian Dumitrescu Thanks very much, Thierry! It would be great though if you could send V2 with "sched" instead of "rte_= sched" in the title: [PATCH V2] sched: check newly allocated pointer