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 C816545AE3; Tue, 8 Oct 2024 18:49:26 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E8A1240E16; Tue, 8 Oct 2024 18:49:01 +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 021EB40A89 for ; Tue, 8 Oct 2024 18:48:57 +0200 (CEST) Received: by mail-pl1-f175.google.com with SMTP id d9443c01a7336-20b9b35c7c7so42131965ad.1 for ; Tue, 08 Oct 2024 09:48:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1728406136; x=1729010936; 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=BQnVRLS9RVade0SF+35UhovJ/CilP2OUV6lgWglyO6Q=; b=mIEYUYnqxnr0EXTvv92Kl4wbBhAM7DkCDJzv7LrJQm0Wo/8knHhnxfpphqfEQG8w4R 0FaU4PA6FTfrApalyx/OTG+Udsq9u5R7HCZ+K17/WQqTfN1G4rXDjDj5l9jYRBgpA6gI qSxOFiYlio2IN4EJQP3/xcj4bHPm5ICgfNvVDEhZTNy/8IEpqvu7f2b9R1w9GQ9na8dt Pq28pNehzYILZqz6vWsxWSTKyejjpR4w1YcYjZd6YfBjwuoICqyhdgnWqTssfDoJqbI5 Emf8yfBV2wN4MLLwDppK2UZRKWxIwsbiRBb8KVOYVBTXebedT1oLy+m9onYvoESFmNM1 Zkuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728406136; x=1729010936; 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=BQnVRLS9RVade0SF+35UhovJ/CilP2OUV6lgWglyO6Q=; b=iHfdG4XlB01/liTy+NWgtDAzeWeSH6cvPcToHhyS27OQiOMrMlqCwQ5RY5uoZjUY21 toVgoXBYYLqwIxZYc2RCtlL5aplXXar0Y71gogus1dXycCL4RUVSEexzRSMOd5clJbUB VEMUnKSwYPOAxKXHaLBA+LjrqzcGH7AU3rpNpumvlgMDjjIQeErqERFl0YdPTvpMoAWm T6EUt3yvjfq3fRWJVBwQNiLA1v9l9qiuu0MGbydIr/IzgTzl87E0LkH/22KuIdUQsB4r 4uBq/E2jJ7ugVa3bkJbqndK8YqQhb6oH9E/ZsTKHw0xG1vgOpDgMbcRML3zencYnO/oE AK/w== X-Gm-Message-State: AOJu0YzWlHrAsgXun/DOe4LJgZB7EEE+oZG+0wZpu/ZS2Um7xb7D67F9 YxbmvRzAnkOrzqw1zLoBvD0VdQbuJ51gYRI6xBjWFAWBl97iq/ulu+3KI7AroXThr3B6DVehjEf IEycQ2g== X-Google-Smtp-Source: AGHT+IHReYt3IHwWDsKlHv/vJnzYeiXluWMRrNmn5C/LeM5UoxcTsZlMZm1jP7tJiV8z4VP5cZmNyQ== X-Received: by 2002:a17:903:192:b0:20b:8bf5:cd72 with SMTP id d9443c01a7336-20bfeb51b33mr217616765ad.49.1728406136258; Tue, 08 Oct 2024 09:48:56 -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.48.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Oct 2024 09:48:55 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , sthotton@marvell.com, stable@dpdk.org, Pavan Nikhilesh Subject: [PATCH v9 04/17] event/cnxk: fix free of non-heap in cleanup code Date: Tue, 8 Oct 2024 09:47:08 -0700 Message-ID: <20241008164842.139045-5-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-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 The code to cleanup in case of error would derefence null pointer then pass that result to rte_free. Fixes: 97a05c1fe634 ("event/cnxk: add port config") Cc: sthotton@marvell.com Cc: stable@dpdk.org Signed-off-by: Stephen Hemminger --- drivers/event/cnxk/cnxk_eventdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/event/cnxk/cnxk_eventdev.c b/drivers/event/cnxk/cnxk_eventdev.c index 4b2d6bffa6..8cc1adef11 100644 --- a/drivers/event/cnxk/cnxk_eventdev.c +++ b/drivers/event/cnxk/cnxk_eventdev.c @@ -121,8 +121,8 @@ cnxk_setup_event_ports(const struct rte_eventdev *event_dev, return 0; hws_fini: for (i = i - 1; i >= 0; i--) { - event_dev->data->ports[i] = NULL; rte_free(cnxk_sso_hws_get_cookie(event_dev->data->ports[i])); + event_dev->data->ports[i] = NULL; } return -ENOMEM; } -- 2.45.2