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 66BADA04A6; Mon, 24 Jan 2022 01:06:42 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0B01842806; Mon, 24 Jan 2022 01:05:39 +0100 (CET) Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) by mails.dpdk.org (Postfix) with ESMTP id 03B7C427E0 for ; Mon, 24 Jan 2022 01:05:36 +0100 (CET) Received: by mail-pl1-f169.google.com with SMTP id c3so13925855pls.5 for ; Sun, 23 Jan 2022 16:05:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=m5u8SZbeHnKwO+LR0Tf92LX8t/vOCtPZna+YbxalHH8=; b=V3m6Mv9U/X7u9AdRsmbkhTq0qmBB7TQjJdLk1H9Ux5iqz8BJeT171THzv+etFptqFt Bsktr5RRD5Wfcqrh6clx/CwALc7t0UYt/av7IPIDCjvDK6pxgjqrLVN2uVoTdMg1NgbS a+jgdkmxqNYCWSir0SBep95ZLEETzSjBXn3AN+Kh2AZ7MXWGhitrgTKwacMyhnhqhV/z AjRAY0YGOKU8g2vxdOV6q/J1rm/6VNJ51mz3xGEHc9vDhJXg60SYpkCAd04TOTSE9O7H trpeY5rjaRW4kyR5ZJsf2tpEpMhQrkp/+K6NKOc4A7Qy/cgdG+QZRHhy39yIILgckf2a 5VZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=m5u8SZbeHnKwO+LR0Tf92LX8t/vOCtPZna+YbxalHH8=; b=QkXBePV7VnBUJhmATWyU3HeuFgigc9j8lhQcydR4A2/xmGlBmIFPXWPvbVbOcMnLhz n0Wqv6Vgo4HAeJpfrluMjkUmTT5pM08a1oNylw+NF+9GCidfJo8naJU15Tf+5pRGMjcY pR1sjLXeYnbxUZRjqLAyMGOXw8hw+PioKfPwRju+YsAvPlmSE747VZ1H9bIOuZgmq8GB no2ODMnUkt4sBbStZmyeMZUX7g1wTvj4mgTCFTav0dJkdw4PBjrxSZ7dKSWJDzpZ3ZpA HIeSuTEQkJjLd13PropIzVqsvHf+6Q9tG6xMjtQujYpoGXOSUJpV9HqRpHg33Qb5Xc6S N82g== X-Gm-Message-State: AOAM532d/hAW3uQCMgdhiLnLY8CRoiVOmYpSMUVFisCTdSAVeQdoh4qZ KR5gJ9iTBjYHvlwtwiKBB9Vsup0PdqpqRg== X-Google-Smtp-Source: ABdhPJxBFYa/XfdOSy5RYg0DFHakroSC/Jj8LicgMR7TqYNtacYgbJ/rtgP7zYfAf3F6g4J81FIk1A== X-Received: by 2002:a17:902:9a0a:b0:149:7da0:af27 with SMTP id v10-20020a1709029a0a00b001497da0af27mr12188318plp.49.1642982734943; Sun, 23 Jan 2022 16:05:34 -0800 (PST) Received: from hermes.local (204-195-112-199.wavecable.com. [204.195.112.199]) by smtp.gmail.com with ESMTPSA id ck21sm10935350pjb.51.2022.01.23.16.05.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Jan 2022 16:05:34 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Ori Kam Subject: [PATCH 13/82] app/test-regex: remove unnecessary NULL checks Date: Sun, 23 Jan 2022 16:04:09 -0800 Message-Id: <20220124000518.319850-14-stephen@networkplumber.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220124000518.319850-1-stephen@networkplumber.org> References: <20220124000518.319850-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 Remove redundant NULL pointer checks before free functions found by nullfree.cocci Signed-off-by: Stephen Hemminger --- app/test-regex/main.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/app/test-regex/main.c b/app/test-regex/main.c index 8e665df73ce0..ab8a3e56e774 100644 --- a/app/test-regex/main.c +++ b/app/test-regex/main.c @@ -210,8 +210,7 @@ read_file(char *file, char **buf) printf("Error, can't open file %s\n, err = %d", file, res); if (fp) fclose(fp); - if (*buf) - rte_free(*buf); + rte_free(*buf); return -res; } @@ -299,8 +298,7 @@ init_port(uint16_t *nb_max_payload, char *rules_file, uint8_t *nb_max_matches, rte_free(rules); return 0; error: - if (rules) - rte_free(rules); + rte_free(rules); return res; } @@ -367,8 +365,7 @@ regex_create_segmented_mbuf(struct rte_mempool *mbuf_pool, int pkt_len, return mbuf; fail: - if (mbuf) - rte_pktmbuf_free(mbuf); + rte_pktmbuf_free(mbuf); return NULL; } @@ -612,8 +609,7 @@ run_regex(void *args) rte_free(qp->buf); qp->buf = NULL; } - if (mbuf_mp) - rte_mempool_free(mbuf_mp); + rte_mempool_free(mbuf_mp); rte_free(qps); return res; } -- 2.30.2