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 BAC0345A9D for ; Wed, 2 Oct 2024 17:45:01 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B381B406BB; Wed, 2 Oct 2024 17:44:55 +0200 (CEST) Received: from mail-oi1-f181.google.com (mail-oi1-f181.google.com [209.85.167.181]) by mails.dpdk.org (Postfix) with ESMTP id 87B1540662 for ; Wed, 2 Oct 2024 17:44:48 +0200 (CEST) Received: by mail-oi1-f181.google.com with SMTP id 5614622812f47-3e28ac7b12bso3712514b6e.3 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=OROIcJkEnjIZPjzXS4seXcEOr/SfVPz/9+clTtJdD9PK734rPV53sTwXlrLP7ATWyO VgRpTr2ZSenRTHFNnHg4ZGYm0AtKyrbXBJ0k2zRBfxinRoarIhfDldrnw4ZSnuA/sphW 2slRDnrnZKlzmis6KnYVC1lDi5penSkralwXW+rl0v702DZilP7rmKGiVYUTU3UETBjZ 9ESwqO1v/ZD6IO7yaqXIuJYALDEAeNRd6GB53fvGjRrNby69QmfXObcOiVfroNEeGU1H 8q6pQKfA5wFj7Ra3WZ85VEmNC1uQjrda4ywGmBLIEL7mwo30xx6yEOmG34Y4DO0SJLRR /pMg== X-Forwarded-Encrypted: i=1; AJvYcCUU9Y7D6/nrHi40w4nVtlzrXvU3uUJ0HyuozXEogHrkExEstq8gjl7Bw/1/2m0J3qGibzPbcmM=@dpdk.org X-Gm-Message-State: AOJu0YxAKnmlIO6drH0RMCQov//DtmxFfItwe7INI58DfPzXMQizqE6x /A03xhJgrnnovgNMjmN4P54f9IgCPtchb8EFhDMz6SlrEROzkDshmjv8IFwx0H4= 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: 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 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