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 CE26C45AE3 for ; Tue, 8 Oct 2024 18:49:17 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0EA7640EE4; Tue, 8 Oct 2024 18:49:13 +0200 (CEST) Received: from mail-pg1-f175.google.com (mail-pg1-f175.google.com [209.85.215.175]) by mails.dpdk.org (Postfix) with ESMTP id 475EC40E24 for ; Tue, 8 Oct 2024 18:49:02 +0200 (CEST) Received: by mail-pg1-f175.google.com with SMTP id 41be03b00d2f7-7db238d07b3so4933090a12.2 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=vzctGH2K4Iow5aRD6n28yRB59gys94xMTnb4hjlH6iThge5TOVuzGzZgYPjr+KQdkg l39PCBBoJRicGH+J+gMwhIoMdjN83hugEObXR8S/fkf1HoeDSvsVfEHMNcetNKr9Lwjg vMbPdhLaQv/EWT9r94ACLyyWTQqfCmLbFC719tC3xNqysvh1aY4Gsayh7LvREMtpGdig nKagcsupia5S4afSg47aUtWP+cUbSdL5s6k7Ar7nheko0s0SUBC+o/yE0TUSUZ/5xnNn /5KOzsEjAIxyOAqTRbgGsBMW3v0++nszG4/lww/1cBXG5zhNja0AaEjGBt5xKIHhd7IH gQNw== X-Forwarded-Encrypted: i=1; AJvYcCXDSbUi2G4Ay3s3SaBoT3xPTjhvh95HHjVJoGM56ctxlOLeHDwTmAigiYsvO+7PfGDZrkHyg7o=@dpdk.org X-Gm-Message-State: AOJu0Yy1sCk4CXms8sQ/LQxkQiEh1KLQtLoUGPHVdqLwq+ItAuWwmJWf p5zN6r5Y8x9yquQUuiRit8ML8eQ1r8UPmJIXVAEFYFQ5DUe/1MYdl62lokuJR84= 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: 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 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