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 47E69A00C4; Sun, 20 Feb 2022 00:43:33 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4DC2941104; Sun, 20 Feb 2022 00:43:28 +0100 (CET) Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) by mails.dpdk.org (Postfix) with ESMTP id 9AAC040E5A for ; Sun, 20 Feb 2022 00:43:26 +0100 (CET) Received: by mail-pl1-f170.google.com with SMTP id u12so9967507plf.13 for ; Sat, 19 Feb 2022 15:43:26 -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=wi4GKxhmW3hqsNds3/hBEZGsPc2sDV2lsUj60vl1Faw=; b=js0F/AKg365YD0TObB7DALqD4z5MJ/+kDgehNP4QvBujD1nOncJ2TgJb5T3lU420K0 blPe1nopj3qkd6MVPflAsdymYtFyHKorDYVG4E2/s31mopD+rZbGM7KOi6W37gtmVEWj OSZ4LCXhOGmI/YorBLVOu55c4swaHvT1ZSt2/HSI9ohnmSKNabYTaW3doZpVo1bbq/xr CxkyyQySeJ+bNjYaOFSp3RFRmlRU7WBwg37vpdtHt8ilCFR6VQKqbUQkN5HRRvIC3LjJ QgXsX2ABUla6a2e8q7IX1i5qkP+BmcsuxpVt9R4rypVi2qxHCDPbz+W8+KiBOBs4ShwM Ih5w== 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=wi4GKxhmW3hqsNds3/hBEZGsPc2sDV2lsUj60vl1Faw=; b=nePZP2C8+7EeeQdsL6K96OPYHorTf25+JAB2zDR+ML29lXHOwit0gPo92QHwRvsm6T vjTvWecwjUIEdPU0LWdwT8DzTFi1ii2q6WwqI/oWFZP+/TFbVzEcvd4/f29WtVUDzIWQ LMNDjtbDm3+u3/w6jjLETEW9pHc4wayh9nlSNtK6AuuvvJf1KUUZA3zH8VLgen+OIrzb ANzo/eTVm3reKlRzw+zkOnpxftKuOTTtRadT1M3IFZskdU3NW18lHUC4rZz3J9sfvhn9 swY7RsjmqMH6qgGGFaU+wcTgvEbmHMxAAnEZpd1dnNxJirAwz7Mt7ZOSr56yvocsyszq NVMg== X-Gm-Message-State: AOAM532Vqacp5v1TjKBhdAhERJYIG3f0uV2rHpQAqn/hQIinKmSTqU9L 9emzACoJukGPcGkwrgqqSNSjtCbvOElCqRP/ X-Google-Smtp-Source: ABdhPJyffSjSouO4fT71zP1Ne055WLJDzyU7QLJ6gXc/67SMV/R8ktV8oGnpI+MBq4FS238vA6OO5A== X-Received: by 2002:a17:90a:2841:b0:1b8:99b8:aa32 with SMTP id p1-20020a17090a284100b001b899b8aa32mr14801168pjf.193.1645314205471; Sat, 19 Feb 2022 15:43:25 -0800 (PST) Received: from hermes.local (204-195-112-199.wavecable.com. [204.195.112.199]) by smtp.gmail.com with ESMTPSA id v17-20020a17090a459100b001b93ef45c13sm3057268pjg.55.2022.02.19.15.43.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Feb 2022 15:43:24 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH 1/3] cocci/nullfree: add more functions Date: Sat, 19 Feb 2022 15:43:20 -0800 Message-Id: <20220219234322.61309-2-stephen@networkplumber.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220219234322.61309-1-stephen@networkplumber.org> References: <20220219234322.61309-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 There are more functions in DPDK which have the semantics as free() when passed NULL pointer. Signed-off-by: Stephen Hemminger --- devtools/cocci/nullfree.cocci | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/devtools/cocci/nullfree.cocci b/devtools/cocci/nullfree.cocci index 363b6149ac28..e7472188ab6c 100644 --- a/devtools/cocci/nullfree.cocci +++ b/devtools/cocci/nullfree.cocci @@ -10,6 +10,9 @@ expression E; - if (E != NULL) free(E); + free(E); | +- if (E != NULL) rte_acl_free(E); ++ rte_acl_free(E); +| - if (E != NULL) rte_bitmap_free(E); + rte_bitmap_free(E); | @@ -19,6 +22,12 @@ expression E; - if (E != NULL) rte_hash_free(E); + rte_hash_free(E); | +- if (E != NULL) rte_lpm_free(E); ++ rte_lpm_free(E); +| +- if (E != NULL) rte_lpm6_free(E); ++ rte_lpm6_free(E); +| - if (E != NULL) rte_ring_free(E); + rte_ring_free(E); | -- 2.34.1