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 34E1745BAA; Wed, 23 Oct 2024 07:47:49 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 040F1402A3; Wed, 23 Oct 2024 07:47:49 +0200 (CEST) Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) by mails.dpdk.org (Postfix) with ESMTP id 231384028C for ; Wed, 23 Oct 2024 07:47:48 +0200 (CEST) Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-20b5affde14so44938465ad.3 for ; Tue, 22 Oct 2024 22:47:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1729662467; x=1730267267; darn=dpdk.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=M/3jyV+W+6wyrTECQTbWekp8ggS8rOg8Rx1ZJpSkuGE=; b=c1VtwzVwn3LEoJ+TJg+jLtSqfObL2c1QqvkmBp9eOd+G9Q0RmSW9Cznt0U/n5CL0q3 NgiEfj1w3OKf80Gd/PauWyq0wjwN8Gt2aecGodxwtopb8mX5uOtAD7uD/uzyItBeaeE4 sxtxfgNwEIzV3d92aZTkbi99RJs7HA5owfD1uOUfMAN/duG6DgCK108CIsxbb2Pyyu24 AWWdgOxeQS4NqX9E4JR64G05A19TRCsCytpE4SNjd9YbdALmXvYiOfLCTpkP0zCOczut bW45elS60sK4Fv8ggi/mL12sakJxReuzmnMdkkcCGKEy9MGElRwc8BsEiLtaZJjxUnAA sdzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729662467; x=1730267267; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=M/3jyV+W+6wyrTECQTbWekp8ggS8rOg8Rx1ZJpSkuGE=; b=s7iXpHWMiGUP9RWo2bcSak8V4bqYtCaamX1J0bxPN3W4d5DNVTQHtm+6hLbjDvgqjm 4qhOqRsPHvnthWuEwp2WJ9fq6VdpLYAAqhXCnymtUAMw1jBwt3mZYRN4secsvnWK79/R VVkWpusYXgK+mG2P0K4BEfyVKYZjP/694wszrj18JC+SgSB9oOROR5gAXoINVdrmNB8Z J5JoevM9n+oIDLejVLEos+Ia4oiybyG5cQT1m+Yupy+oL04nYDt+Mv9iywreqD8PEfG7 XrfhQbO7MXqe7IAY0DIHELIoT9MtznIsRMiddiqI2b6jgwyIVDI+TvlA06ywypYHZudO D+iA== X-Gm-Message-State: AOJu0Yw5tQRrcT97hBKdqusbi9qJ1m3Jvhrv6MKHjklisvMfHLjlIdlZ MZEkP01ETA37o5YsysnGTqHFDFSlK39Mrah6YdEKZmXr243ix+ux/XjuF9cEhaIhsx5GH9f+8LV 5 X-Google-Smtp-Source: AGHT+IEgZRd0ahsLOE8tMZvqAFrvBo3OPO25//0VwEllcT8RFYK7P1g+KkW4tHhtx9nsE3cmm0c9Aw== X-Received: by 2002:a17:902:cf07:b0:20b:8776:4902 with SMTP id d9443c01a7336-20fa9ea14cemr20772235ad.38.1729662467014; Tue, 22 Oct 2024 22:47:47 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20e7ef0e74asm51124235ad.77.2024.10.22.22.47.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Oct 2024 22:47:46 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , okl-plv@napatech.com, Christian Koue Muf , Serhii Iliushyk Subject: [PATCH] ntnic: remove unnecessary null free check Date: Tue, 22 Oct 2024 22:47:38 -0700 Message-ID: <20241023054738.528445-1-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 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 No need for a if() check before calling free() since NULL is allowed. Found by nullfree.cocci. Fixes: 1d3f62a0c4f1 ("net/ntnic: add base init and deinit of flow API") Cc: okl-plv@napatech.com Signed-off-by: Stephen Hemminger --- drivers/net/ntnic/nthw/flow_api/flow_api.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/ntnic/nthw/flow_api/flow_api.c b/drivers/net/ntnic/nthw/flow_api/flow_api.c index 34e84559eb..ea3ef65ecb 100644 --- a/drivers/net/ntnic/nthw/flow_api/flow_api.c +++ b/drivers/net/ntnic/nthw/flow_api/flow_api.c @@ -205,8 +205,7 @@ static void done_resource_elements(struct flow_nic_dev *ndev, enum res_type_e re { assert(ndev); - if (ndev->res[res_type].alloc_bm) - free(ndev->res[res_type].alloc_bm); + free(ndev->res[res_type].alloc_bm); } static void list_insert_flow_nic(struct flow_nic_dev *ndev) -- 2.45.2