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 196B045A50; Sat, 28 Sep 2024 18:49:33 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4AA66406B4; Sat, 28 Sep 2024 18:48:45 +0200 (CEST) Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) by mails.dpdk.org (Postfix) with ESMTP id D3E9640647 for ; Sat, 28 Sep 2024 18:48:35 +0200 (CEST) Received: by mail-pl1-f175.google.com with SMTP id d9443c01a7336-205659dc63aso29493145ad.1 for ; Sat, 28 Sep 2024 09:48:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1727542115; x=1728146915; 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=igv7H2LGr40PrX5C7PPQvmJLSQgVopDkrd4Lp94/mVsEuSHk7J3J1l3r6pPSf+c1Na Z3mAZnc43sPH2XnlIRpp20mRbSHrv9jbhoPxJvVOKMrf7Yv867fthB/pY2x0IvnsqQ7w OBERIkaKNT5G4tpgeSK0KS8lXac0l3M4PhibZVAmz4R+L8yOqaOtdBPTGHUEgGyIfUPz qacPN7H2PhvzwfcK19290Cv0xbvao0inebZZZpsLZR3UlYoGuICR80AONjGvm1K8OGSj 6rO2mmJWIQNFXqEZteA85cUgqo8A6VGaxk8lHjsGFLIb+z3n0ts+45V3Da5bm8jMk5Ud ly/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727542115; x=1728146915; 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=ompuZYQJIXtEehnRJnJkvA31a8KhaKKT1qvE42Cnun2OUKYec6nF7ErLfLuByj31zx uI5tyhjucDeV6PWS/VryGfXq+nVk+sa0Dqo88f1aHWmmKopfZXV4QYVZcqEm44HabO35 bEtt7RzNvs7x1XSB0ksA1AEIjHi3yF7LLOziI5Fsu5NS8nVJBDT4H0qErX/rdWG7ZbMK 3ricS0BJAmGX4W7U5Nsl3I9Mayn+Y1NRC3Wed6MXwiERcQAf24NeB8hQRUlhh4arOykJ aTVamG0BM5eWGOA3sgXUvWqxHoT7SBRnlbPfM6bl6IYZ37T60TvvGfEAXYJ7UnigyLBg WFNw== X-Gm-Message-State: AOJu0Yx4Zwn8I1t9S5bv0MdutHoMMeBCfQn7CXYJWrmoPUAE9WP1tHAT pfvJIJjKOds3sunS/RN6ltgCTaTV5ElAS2doM1IrpbUJj3K+8xf3yzUaSHfu4Ljin9iHz8Zb6Pd J X-Google-Smtp-Source: AGHT+IH/qgzXbp8zuaPZc0ETJFx23qPLhwFdw7wySEEWkn7GBMDnYY0desEFfbO/hbeCz7bn3/BlDQ== X-Received: by 2002:a17:902:d4c2:b0:207:13a3:a896 with SMTP id d9443c01a7336-20b369d605fmr95182015ad.23.1727542115024; Sat, 28 Sep 2024 09:48:35 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20b37e47c7dsm28854015ad.216.2024.09.28.09.48.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Sep 2024 09:48:34 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , wenjing.qiao@intel.com, stable@dpdk.org, Qi Zhang Subject: [PATCH v2 11/16] net/cpfl: fix free of nonheap object Date: Sat, 28 Sep 2024 09:47:19 -0700 Message-ID: <20240928164814.861933-12-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240928164814.861933-1-stephen@networkplumber.org> References: <20240927204742.546164-1-stephen@networkplumber.org> <20240928164814.861933-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