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 693BCA00C5; Mon, 14 Feb 2022 14:35:08 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E189A40DDA; Mon, 14 Feb 2022 14:35:07 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id 7FDDD4067E for ; Mon, 14 Feb 2022 14:35:05 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644845705; x=1676381705; h=message-id:date:subject:to:references:from:in-reply-to: content-transfer-encoding:mime-version; bh=byTZIDgbkeA7jXqUOSK13LrWbY0SStVHV/mx8wO3GZY=; b=BeT3MhyIPrCOznYSEHOaPXDS12G0eHPndzkFM098IGColJkF+XlhyMrk 0jeRWGz2P/lh3h+yxFaVxiUZh6yaTkwS0WUsFdQc1SJYz0VevKPAGeLA9 52B+qKmErjizTDNZ54fOQdCFQhaNa1lRiVi79JdhAyZz/YuPWCJpmC6T/ o5P8zbx7xIk9OZfhQ7LAnLKZJ4+wD+tOOeVUL4eyB3unQJugJfPaRggkn tZbga+tUX4ydJ2Hl+kg6POSfJeunVGL4SjgX3kIGHlRaq6r8Z9vWEji2W mZKC6D0875mvjAKSKbIeBa09oaOyA7NPNWLzuRRFrmaF3+XuWG3ozUMIe g==; X-IronPort-AV: E=McAfee;i="6200,9189,10257"; a="274659665" X-IronPort-AV: E=Sophos;i="5.88,368,1635231600"; d="scan'208";a="274659665" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Feb 2022 05:35:04 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,368,1635231600"; d="scan'208";a="635195646" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by orsmga004.jf.intel.com with ESMTP; 14 Feb 2022 05:35:04 -0800 Received: from orsmsx608.amr.corp.intel.com (10.22.229.21) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Mon, 14 Feb 2022 05:35:03 -0800 Received: from orsmsx605.amr.corp.intel.com (10.22.229.18) by ORSMSX608.amr.corp.intel.com (10.22.229.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Mon, 14 Feb 2022 05:35:03 -0800 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx605.amr.corp.intel.com (10.22.229.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20 via Frontend Transport; Mon, 14 Feb 2022 05:35:03 -0800 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (104.47.73.42) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.20; Mon, 14 Feb 2022 05:35:03 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iX13iZ6XRgcTBhYAJKklRypoO2G1x8secAsZUR3vlqMwdzG3eeZjWRRhMbY5j2DxxIWDWXp38GLRJ4OM0+c9/6Oo1zNQsv6+itUvEHYVNvSO5o6pLFvkIwTC/EymTTSYMUQ63jLW/MZWomxeWEeGEpKXrRguTkZdDemrXMl/ho4ahN4IPhyKlyvMv2tN5BaqWCAExViLOSnbkI1hO3Oz554MJ/8BjuCJYyvtIuQnhQCJ4GZts2hPuR1lJyaQusBS9VrZmip6hb7HxqcV+gBDIFvKyPiToMJy1U+bZbKv9a0+uJi4Ht/vzQvEPoyP5oxm4HuL5fzUYtnm49FDR+SPRw== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=de2OL8u6+fdGOvALhkiBjdHfuQ/EGWLPbwHhvRe4Xik=; b=d02Q5SjokM1p38PreKGC8kfTEcyYxWzuNukxTxitQX6zvZmouPEf2U9MsCqQ7/3vfOqO2uKjEWx3LzO8AQOFivQfy0CQJcyVh43GqmZB00xzrbzNBHlNBP1WcXWdhkaIhEcYGHcx5Q1vWrWHn2iYseC2qh7m211HLBIyIzfId0wJqJeT0M7LTfAWHlGnzfbiwJ5zrJj2m2Rcw2pDhgfMeeHmKqNGnmd8XpHvNJahXly8tnZB+WrmSwoSpNPA1x1lrQDjWPT0sXDbd0k/QwZIU9EK0AAa91r05QFcAhSUhDstqHC1sWtcy9trvJEFmjMFVyxxCH6U3OKfM+9ae8omhQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) by CY4PR11MB1349.namprd11.prod.outlook.com (2603:10b6:903:30::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.18; Mon, 14 Feb 2022 13:35:01 +0000 Received: from PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::98be:5506:5020:28a2]) by PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::98be:5506:5020:28a2%4]) with mapi id 15.20.4975.019; Mon, 14 Feb 2022 13:35:01 +0000 Message-ID: <2a4708db-c0f8-d883-d4a1-b775e0dd8fc5@intel.com> Date: Mon, 14 Feb 2022 13:34:56 +0000 Subject: Re: [PATCH 2/6] drivers/nfb: fix array indexes in deinit functions Content-Language: en-US To: , References: <20220214112541.29782-1-spinler@cesnet.cz> <20220214112541.29782-2-spinler@cesnet.cz> From: Ferruh Yigit X-User: ferruhy In-Reply-To: <20220214112541.29782-2-spinler@cesnet.cz> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0017.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:150::22) To PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9b34d20e-db8a-4b63-d4ef-08d9efbeccf3 X-MS-TrafficTypeDiagnostic: CY4PR11MB1349:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2958; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Kd4FDPL6mzg3z91rhbuUmMyApmtMLKJnFcw6z6oQ/Uk2Qol+j4hqz6n+DknNCbL8HOuhneGKSYI3OJ2gKK+9EbW9YwVOTA7uWds7yEX2+i3rtKnQsF7XvvhMy1lEiijpIZa5hsZfMHLMcOkh4/GsTVob//PrPpcNWycPRJbO8py88sM21GiPsK6AXZlsGdARaSYtj3w0SKjsh63IUktZbb2axuZ8rDrkAznzNvTm599tLwzveMeXZ+VrpJJisIz3kWkTcp1W524PnlT4aroSYngF6KP6VEURcBxATah7MwcIvgPhQaZRbrzJy2Jj0DcseX4xibY19lLP2CwZtrQbvpD4wmMMTeTnF+1HRuSj8JMB++XjP6bR6SaoBjYlNXaJXzhmncB0zGCWHqF8PAEisdtx160YGpMufla/YyWCF0S767iRGjDAI99is86tQecvBkRqmhUrNtfHO2+5hLO7Ri3GL8HTIHjfIzV1TLrab8MqjfbowUFNus3GxIXcUYNCd06u9DWZvlS79XCzp5uidaK0GzPidJHb7Hs1ci4tQuRw9DPh8kqmr19NXVFs0/fmq39Bo6+c5wxlq67cXOYdpQwXw4aM2c+CKuXWY7i5G8b2QO82mcwH6Z3cStLGnoKKNrRemvMtgelion4ES4R//eJfdARn0lGvm3m1rHzVKII3XGXVnYme2YmJS8ozIziRcXREVSeqeP3UEWMKuG8c9Q== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR11MB5000.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(44832011)(186003)(8936002)(66556008)(66946007)(66476007)(2906002)(5660300002)(36756003)(31696002)(86362001)(8676002)(82960400001)(38100700002)(508600001)(83380400001)(6512007)(2616005)(26005)(31686004)(6486002)(6666004)(316002)(53546011)(6506007)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?MjQ0VFBjbzVVK3lFMDUweFhmZUVmaFJJT3RSZUFpNGxHVXY1WFBHZ2hPdXZw?= =?utf-8?B?TmJoK3M0ZjFFSmx5S1JwOWxBRXV0K0Z3N1JMRlRNRzJacjluenlPclhNRlZJ?= =?utf-8?B?YzJ5enMvOXVMWUdYZk9pV2hFckdyNWYya25wOFpHZCtuaUZaTnIwRUYya2VJ?= =?utf-8?B?TjNjZ2p3VmFQaHk5OFpaeEw3UG4yZlRlWC9zY0ZXd3Fkd3B6OURVRkdDZjJZ?= =?utf-8?B?ektNRERJQlZGVlZNaGVWMTN5bEpBdHE0U002YjNqNmxia0YvMjYzUlhwOExw?= =?utf-8?B?RjRhNVk0ODlPR3ZrY3VBRzVBTDdKQzFuYzdWZ0ZPQ2J6Z2dqK092NGd5a0FR?= =?utf-8?B?dU9ySGlDTjlVSDBVZUVGQ1ZXbXR1OGtNZDVGbDAwTHo1d21vQ2ZPbkN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bhciFic0dtwZPjEDIE=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 9b34d20e-db8a-4b63-d4ef-08d9efbeccf3 X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5000.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Feb 2022 13:35:01.4116 (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: krlW+AbIJ79MWUFWsX9nmxpOi/LciV+Jzd+Z5SfbTSu00mtwXHJGE7pZ9LvpWs8EEtETeHn86xxscZHiqvzvww== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR11MB1349 X-OriginatorOrg: intel.com 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 On 2/14/2022 11:25 AM, spinler@cesnet.cz wrote: > From: Martin Spinler > > The indexes in the for cycle were wrongly used and > the code accessed outside of the rxmac/txmac array. > can you please add fixes tag, to help backport. Also please add stable tag to request backport. > Signed-off-by: Martin Spinler > --- > drivers/net/nfb/nfb_ethdev.c | 14 ++++++++------ > 1 file changed, 8 insertions(+), 6 deletions(-) > > diff --git a/drivers/net/nfb/nfb_ethdev.c b/drivers/net/nfb/nfb_ethdev.c > index 3c39937816..0b27fe78cc 100644 > --- a/drivers/net/nfb/nfb_ethdev.c > +++ b/drivers/net/nfb/nfb_ethdev.c > @@ -77,9 +77,10 @@ static void > nfb_nc_rxmac_deinit(struct nc_rxmac *rxmac[RTE_MAX_NC_RXMAC], > uint16_t max_rxmac) > { > - for (; max_rxmac > 0; --max_rxmac) { > - nc_rxmac_close(rxmac[max_rxmac]); > - rxmac[max_rxmac] = NULL; > + uint16_t i; > + for (i = 0; i < max_rxmac; i++) { > + nc_rxmac_close(rxmac[i]); > + rxmac[i] = NULL; > } > } > > @@ -95,9 +96,10 @@ static void > nfb_nc_txmac_deinit(struct nc_txmac *txmac[RTE_MAX_NC_TXMAC], > uint16_t max_txmac) > { > - for (; max_txmac > 0; --max_txmac) { > - nc_txmac_close(txmac[max_txmac]); > - txmac[max_txmac] = NULL; > + uint16_t i; > + for (i = 0; i < max_txmac; i++) { > + nc_txmac_close(txmac[i]); > + txmac[i] = NULL; > } > } >