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 C8E1345A9F; Wed, 2 Oct 2024 20:40:36 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D544C40691; Wed, 2 Oct 2024 20:39:45 +0200 (CEST) Received: from mail-ot1-f50.google.com (mail-ot1-f50.google.com [209.85.210.50]) by mails.dpdk.org (Postfix) with ESMTP id 8EEA24066F for ; Wed, 2 Oct 2024 20:39:37 +0200 (CEST) Received: by mail-ot1-f50.google.com with SMTP id 46e09a7af769-713aebfe8b8so87858a34.1 for ; Wed, 02 Oct 2024 11:39:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1727894376; x=1728499176; 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=liBu4wD2fPoSmZhf8M1vszK+cHaH5f/mXx/c/IUbWdK9HIW/0B2xZ+sAx1P/nCJxnv aW9wblQyJ9yI59T2LMtBDQUmwXzpk5qQn8JA/HvXDwYK29YfWAT7b+tw2ig0mVZVxp5G MmyidK0PRFPVdopkTPrGYPvW6H4vrv3U4d1xrhxDY+UJ/AiZ6G2axEo2WKcFKxmjVtYq lOyXPcDKXLExD4KYtFZN9d3qfn33Pmysq+2f6GILQT1jYFA8ie1Jeus7ZSKLYTN+8t18 WdZukDXGl+6KdHCab0sDtNG9BQa+7akB0cWZ/mCfbMVHRaYamUYtJ5F8gcfJ6TZ+5bR5 r15g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727894376; x=1728499176; 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=VGemJNQoXgNAVb/FIxwc/tuxPk/EcvEggSqVGSeLYSfNA5P1ZD9iHsR/PbiMxaHD53 4CgPo6/Az0h23Daux36BNc59KHGPDnGoiBU//9UcpyABvsnvXW9ozRosfG3XE49mkfPH fJEn2bLUBuCtPwXxb1vQQ7P4aVLtMYqIezaNLSuHxjCgyePA+F1yx+mdTtEHKzuIqNK4 lZqGvGMidk6RUGjKOz3JzoeEAtgDu+tXYmjjTFxyxVuAHawc4SbZN1Hw6Jc+GA/IEXua IlqkjcOiW2asYhty7JqMqEIcMv9UtetlCL8EgaZata/NN52eM1hKjxm14CK2Ag+V2lCc EfQw== X-Gm-Message-State: AOJu0YxODRDj2QPb+QIYqDXGqqgRLkxnvk65vqASWJYK6YFgC6jYhuUu 44AWQzeERUhMnUUftP9dYLkRJ/I5QP0hwRVmm5aBw8h5FQRJzgbh4u+r5IxlGSJSyRFnKaJQoRF N X-Google-Smtp-Source: AGHT+IFIksrmI08bOSeFZHC2vIqXHi51DYaKIomo3HVa6fCmIolo4ygxVGGefHQrZh2OgDqjazhL1Q== X-Received: by 2002:a05:6830:440a:b0:713:658c:cb2d with SMTP id 46e09a7af769-7153cd48010mr2820323a34.7.1727894376651; Wed, 02 Oct 2024 11:39:36 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71b2649b0bdsm10104362b3a.34.2024.10.02.11.39.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Oct 2024 11:39:36 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , wenjing.qiao@intel.com, stable@dpdk.org, Qi Zhang Subject: [PATCH v7 10/16] net/cpfl: fix free of nonheap object Date: Wed, 2 Oct 2024 11:37:48 -0700 Message-ID: <20241002183918.161656-11-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241002183918.161656-1-stephen@networkplumber.org> References: <20240927204742.546164-1-stephen@networkplumber.org> <20241002183918.161656-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