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 2727945A8E; Wed, 2 Oct 2024 17:46:02 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 818A54067E; Wed, 2 Oct 2024 17:44:54 +0200 (CEST) Received: from mail-oi1-f175.google.com (mail-oi1-f175.google.com [209.85.167.175]) by mails.dpdk.org (Postfix) with ESMTP id 88BA140663 for ; Wed, 2 Oct 2024 17:44:48 +0200 (CEST) Received: by mail-oi1-f175.google.com with SMTP id 5614622812f47-3e04b7b3c6dso3580331b6e.2 for ; Wed, 02 Oct 2024 08:44:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1727883888; x=1728488688; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=5rIUygztSKBo8hXRl59YcTQfr34c1sPRuIObTaqdxdQ=; b=DjCXBxmjA8Ng7xiUW5XMeUh4FOrz2XJKaIbjjhUrzbaWLvV+YOQJs/HWenWq6nSCQQ YSRX6x5XBdZsX8VDxbVqDeU82zu5nSIcLnfYej88jl6AaCQj7E+Ze5l10dRnlv2KS9zk vlUEh62Oj60AS2X8C7aUoXZB0n2Bskl8vrKmm4y0/9VWgfeQRgoEE5ATq2OHla0eBfAn 31rTCg11tMmX4r+o2vVCCKzNkTAlZUcmTLBWc837BLFX1Usu3BXL/1JIvxj9r2KvlxJI WQxwM3POh2e/yoT5bwFhe+N64bnVCwd/LpxKjdx4bpCSdtBnxxFnYS4t7iNAkmaVcvyg TLuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727883888; x=1728488688; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5rIUygztSKBo8hXRl59YcTQfr34c1sPRuIObTaqdxdQ=; b=nVFREZZYSvwBOwFf77if4g/kWgXgGEOUH0ZIaW9tjSFi6UlK6TEOkNyG/6FtEqXHWG yYyOQE+E5+n/vQ5jl+e+tetQDRVdv3YrIt7Tf+868nT6roRofhSJYZgdamLT4N/rKlQv 9ZFOInnAS4i6L4LkfOXRwO31P4IdLBidAriEFpZMhvToVaSoSC+Yzo1BtVD2/BDvsb05 PzfNHeFgzSesovdOrkh3ACKeuCdWgiiCiA7kmLTm5FAqzIXSuF6qpsiFW/0m8KpQnjZW CtiEHfZGG5J7X+ljJRFdQriZZRV+/BF5+aAE1VSWkzLHtMPU/EGH1xhdjFcZfcY/VTFW +JZQ== X-Gm-Message-State: AOJu0Yw9HAGSN2jxj/yQfSDYbMrjZq7UvSASIygW03AmCDqsdZPUAz71 hqpLLHaZ8qELG++1zPFC5H9DPad6n5KuKIa6OdO1iK2IMDBbqbGeQp/DjQzabQpZdGIyGX8gtPO Pg8o= X-Google-Smtp-Source: AGHT+IGftJ8hqOHa5YVIE1aD4glpmukAeD3vqsPyENeFwv+u1sEVUA2LffwTWQCjeJsIp834anLgfA== X-Received: by 2002:a05:6808:648e:b0:3e2:92ca:92d3 with SMTP id 5614622812f47-3e3b4169f2emr2619764b6e.34.1727883887828; Wed, 02 Oct 2024 08:44:47 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7e6db2927c7sm10247363a12.1.2024.10.02.08.44.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Oct 2024 08:44:47 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , wenjing.qiao@intel.com, stable@dpdk.org, Qi Zhang Subject: [PATCH v6 10/17] net/cpfl: fix free of nonheap object Date: Wed, 2 Oct 2024 08:42:54 -0700 Message-ID: <20241002154429.64357-11-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241002154429.64357-1-stephen@networkplumber.org> References: <20240927204742.546164-1-stephen@networkplumber.org> <20241002154429.64357-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 With proper annotation, GCC discovers that this driver is calling rte_free() on an object that was not allocated (it is part of array in another object). In function ‘cpfl_flow_js_mr_layout’, inlined from ‘cpfl_flow_js_mr_action’ at ../drivers/net/cpfl/cpfl_flow_parser.c:848:9, inlined from ‘cpfl_flow_js_mod_rule’ at ../drivers/net/cpfl/cpfl_flow_parser.c:908:9, inlined from ‘cpfl_parser_init’ at ../drivers/net/cpfl/cpfl_flow_parser.c:932:8, inlined from ‘cpfl_parser_create’ at ../drivers/net/cpfl/cpfl_flow_parser.c:959:8: ../drivers/net/cpfl/cpfl_flow_parser.c:740:9: warning: ‘rte_free’ called on pointer ‘*parser.modifications’ with nonzero offset [28, 15479062120396] [-Wfree-nonheap-object] 740 | rte_free(js_mod->layout); | ^~~~~~~~~~~~~~~~~~~~~~~~ Fixes: 6cc97c9971d7 ("net/cpfl: build action mapping rules from JSON") Cc: wenjing.qiao@intel.com Cc: stable@dpdk.org Signed-off-by: Stephen Hemminger --- drivers/net/cpfl/cpfl_flow_parser.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/cpfl/cpfl_flow_parser.c b/drivers/net/cpfl/cpfl_flow_parser.c index 40569ddc6f..30abaad7c8 100644 --- a/drivers/net/cpfl/cpfl_flow_parser.c +++ b/drivers/net/cpfl/cpfl_flow_parser.c @@ -737,7 +737,6 @@ cpfl_flow_js_mr_layout(json_t *ob_layouts, struct cpfl_flow_js_mr_action_mod *js return 0; err: - rte_free(js_mod->layout); return -EINVAL; } -- 2.45.2