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 4B46845A6D for ; Mon, 30 Sep 2024 20:46:20 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CA8EE40666; Mon, 30 Sep 2024 20:46:18 +0200 (CEST) Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) by mails.dpdk.org (Postfix) with ESMTP id 358F2402D3 for ; Mon, 30 Sep 2024 20:46:14 +0200 (CEST) Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-20b6458ee37so25570385ad.1 for ; Mon, 30 Sep 2024 11:46:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1727721973; x=1728326773; 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=v8Aok7msKv3e47qbX+0n/i5gaFzOgWTvqMZUsJlTOls=; b=EUwQ9pm1kQLy4Mh4cBn/W+2z+ynZcZEVPsaXv3FBflz6TUsGYgJV5dF5MOyIUsPlhx V3oHeefs2BpELtY5/bEyI1KCyzHWsHRz5HMgEExrU5CtEpwihGlXZcxIDmxial9/8QNr OMkv9XeAYEINrv0jD7PgceErjG3d22pixD+6npilijxLh+VVuikou9nApwuKLm3Q4aF3 NfEtRTWlMHP+NgbNYfhnkR0ofTnN61uX+SsPF3LP1NF+n4E3DcVc8bBYzhCwWBu4t2P3 M2MXTOCXnnhW3BP1M6p8Y6jHZq+gx15kjzFLzQ12iuCGJaAecQh6Q2sQOWIEdGX7F9vN 5CvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727721973; x=1728326773; 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=v8Aok7msKv3e47qbX+0n/i5gaFzOgWTvqMZUsJlTOls=; b=X37K9/8glZUy5YvCISfdUnVVDrTb7URXSyOjKDLrkDvTiifNwZhreJ5WK0rQN94h3q OZKFO+ikJF1OZsHpsUuB9awuQWhU4fbHoZky0JUdMnVbPNbcdxdM8CEy58+4oX4EgKxy G6Dls85RdIRAVnpBUmVwTNAu6XC3uE7Y2Zb8BB5D712ZMCsYhu1ifr2lC/vU9D9lumLP 0rfgV2K1G5i0WmiVxb73HGlYiijjNxXPsQCsMQ2xdPj7tJZbJBl4ovvCI209hR+RofUv OInupR6oNwDzibkUnJ8+PrcqDSkBPF7NxXDjSjEx9BurvTx+NvO+5Ycx6TVkso/L97gU eV6w== X-Forwarded-Encrypted: i=1; AJvYcCW3tCHEAOChxyJuzPj9pb0M4Z46045jrIFwHeV0yC6zzKLYLScNMVlPqtU/vb8iuTy/BC1Sai0=@dpdk.org X-Gm-Message-State: AOJu0Yz3lYF+pqwpOHc0bdT1+tuZpLvLN2MBVXMsMRSqfqzvZvoqbKog mJLBS3ri4noDPMfEa1dPnwkUJ0P8sM2qU4cs56qMq8LVNqB/mPtFs66ULlYK6DU= X-Google-Smtp-Source: AGHT+IHYfHFYsyaXRilGs0TgiC88PgocRljLlHZwtNAUD+TFqWjYoAGg3cEZjInoxd2uEBCnLN7L0A== X-Received: by 2002:a05:6a21:6b0b:b0:1cc:e409:7d0c with SMTP id adf61e73a8af0-1d4fa6bf662mr20864119637.25.1727721973384; Mon, 30 Sep 2024 11:46:13 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71b264bcca6sm6581895b3a.78.2024.09.30.11.46.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 11:46:13 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , sthotton@marvell.com, stable@dpdk.org, Pavan Nikhilesh Subject: [PATCH v4 04/17] event/cnxk: fix pointer mismatch in cleanup Date: Mon, 30 Sep 2024 11:43:58 -0700 Message-ID: <20240930184600.7092-5-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240930184600.7092-1-stephen@networkplumber.org> References: <20240927204742.546164-1-stephen@networkplumber.org> <20240930184600.7092-1-stephen@networkplumber.org> MIME-Version: 1.0 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 The code to cleanup in case of error was passing incorrect value to rte_free. The ports[] entry was allocated with rte_malloc and that should be used instead of the offset in that object. 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 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/event/cnxk/cnxk_eventdev.c b/drivers/event/cnxk/cnxk_eventdev.c index 4b2d6bffa6..08c6ce0c07 100644 --- a/drivers/event/cnxk/cnxk_eventdev.c +++ b/drivers/event/cnxk/cnxk_eventdev.c @@ -121,8 +121,10 @@ cnxk_setup_event_ports(const struct rte_eventdev *event_dev, return 0; hws_fini: for (i = i - 1; i >= 0; i--) { + void *ws = event_dev->data->ports[i]; + event_dev->data->ports[i] = NULL; - rte_free(cnxk_sso_hws_get_cookie(event_dev->data->ports[i])); + rte_free(ws); } return -ENOMEM; } -- 2.45.2