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 2A03845AE3; Tue, 8 Oct 2024 18:50:20 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C780340EE2; Tue, 8 Oct 2024 18:49:11 +0200 (CEST) Received: from mail-pg1-f182.google.com (mail-pg1-f182.google.com [209.85.215.182]) by mails.dpdk.org (Postfix) with ESMTP id 449E540E1F for ; Tue, 8 Oct 2024 18:49:02 +0200 (CEST) Received: by mail-pg1-f182.google.com with SMTP id 41be03b00d2f7-7e9f955cb97so1623258a12.3 for ; Tue, 08 Oct 2024 09:49:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1728406141; x=1729010941; 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=Eic6BVDwTvlRyCaygh6PjhzUg841CjLidZBg58UU5PI=; b=iqtpgGRKUSLKajgriRmwgKKPCKn2ev79RV0NDkJArSRUqGxOpmRSwyGA5gK+Z2LtO7 yPexqxQ6K3QUcgDF0fZ2ffv340V/wDRkugTbSjYABuua78+B2MajTyLMNPYZOFIi2owD sxfo+D5lLgi/tTpGh6w731/P6b1vFm0OjK7kfFZ4op6E9itO2hdku9DLoJkS/4bggrZB x4ogVQ8h1uWepE40f5mO1vAvuG2cSGhVLuTc6KH5ffER350E0h3dkWzCkPPW87tW2NB1 0ZIrTWuSKxCmHARal1uBtmQAJeHqg3TU/j6o0SkFmOhaV8djOfUDpJ2oqOxw2EIuo/YU 8hQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728406141; x=1729010941; 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=Eic6BVDwTvlRyCaygh6PjhzUg841CjLidZBg58UU5PI=; b=QjpkmXaHx7SPyfsHQ0tk91EDvbRou3AGyloYxL/tIifzhVfvaWW5nBp9v8nF6crtzX WB9E0IN0eMhidB73UyuvCX4V4+VkoVnRahDR+B6kfdEvH3cKJHW/Sro3kQEVmuhJfVNU wcUq+KXJISdmBlt+KrV5bIoodjPV6ZkMS9ZxH/QtIvlqWkVZ5w2FcdbYNW1fFDXL7Nde fIw3Dc+O++UrPK3Db7b88/9C9nMpyJ+P2HGl9enyG91HPEk+lKWSg5v81pot7QngbnwW IWSYJRBBmTuyRbplIDnRo5U9jj/cewC9dnU8uyhY0iIcP745Z49/4qBVAIIa/apza3dq sCzA== X-Gm-Message-State: AOJu0Yw3MewDXHSOHOJ7Ppez4q3rvJZsGJcvqlsY0eb2TY7eqk9NRrJo evzmLWPHM3hwybcS3dR6nEDF5VyyXNQVQiXD3MkIjMkbjghm7oktLl2kHuapCNek/IsSqZQYA5p 9+YQ3UA== X-Google-Smtp-Source: AGHT+IEikNcA23313MW/ZRw4/YTWFJ4eNln6ShIMaNdQBVSjK1gi939Qx8L8RBpcMJEpNURmOTAXWg== X-Received: by 2002:a17:902:cf08:b0:20b:4348:da58 with SMTP id d9443c01a7336-20bff0698c6mr235430265ad.54.1728406141473; Tue, 08 Oct 2024 09:49:01 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20c54056bd9sm13832965ad.85.2024.10.08.09.49.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Oct 2024 09:49:01 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , wenjing.qiao@intel.com, stable@dpdk.org, Qi Zhang Subject: [PATCH v9 10/17] net/cpfl: fix free of nonheap object Date: Tue, 8 Oct 2024 09:47:14 -0700 Message-ID: <20241008164842.139045-11-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241008164842.139045-1-stephen@networkplumber.org> References: <20240927204742.546164-1-stephen@networkplumber.org> <20241008164842.139045-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 011229a470..303e979015 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