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 4DDE745CF8; Wed, 13 Nov 2024 16:56:38 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 40B8740290; Wed, 13 Nov 2024 16:56:37 +0100 (CET) Received: from mail-pf1-f170.google.com (mail-pf1-f170.google.com [209.85.210.170]) by mails.dpdk.org (Postfix) with ESMTP id 10F964025E for ; Wed, 13 Nov 2024 16:56:36 +0100 (CET) Received: by mail-pf1-f170.google.com with SMTP id d2e1a72fcca58-71e681bc315so715674b3a.0 for ; Wed, 13 Nov 2024 07:56:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1731513395; x=1732118195; 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=0yn/VFEi3Z09h6XYjEMHcYP4Anb8Wnu5dWs0c5vkMbo=; b=zQWqOvhllvtmk3xBAHTRlJMP6VWPS2/d1AF5mBQk2ds9ASBc4tmFc5BMvkFx9XyQU5 Hpwt1Ll/tZIbFm2DZhkLpOdz78FPW3mKj9CXjQR2Eag2kW9FlIo3P96C+VBuH6WUFkYc 4s2plPhyi6HM7Iw6l06/IdDV99EKh2HwKmLyBbQrNO+NdXRrBXvhRTSverZJc3UwKvn1 4+s6AMwmTy7seYb0lMoLvT101K9cmvLdwyg961L6fpHcaq1cZETObI1BxoUxebjBXiZN FEOjtlUeAvWyh4pzomexZu+3wgxp/8UrbkM9fQNvuJu4fROwAGRKytYIJVUCuieJDFYT hAYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731513395; x=1732118195; 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=0yn/VFEi3Z09h6XYjEMHcYP4Anb8Wnu5dWs0c5vkMbo=; b=EoLztBbLYu05rPfKc0KmL9ndXq8MG5PmtPU3C9VKG1OJFtAHXDcfKCtRed+ian3cHH T7NL1pTv2TYkA5PHE6ksKldkqGWyTl5xBHs+fbTNC3wvRkTmBWpMv7eBrypLc4hp5NW5 8kWH/Obswo2lu+15jsghyNmsK8ZwrTjeuUw4MaS3IeFEnVz9uMR/1mdzDMGJQtWRcJPf I4IN509NZbLUR8+zJ4ub90BInXhY73M/aEL4WWVoh/fLBHR3aRFQ1loSLil1zspbr89G +bsReshQEsO2Q5hY+EjMdPycFIfoj8ZPMdDAbOUxQtsU/q6IG9cNP2KozyyQJgaDEtUk XmSw== X-Gm-Message-State: AOJu0Yy5CYN/3luyjGgyx8wimju6bdYvfuKGtKFj4N67S6VW5VpCgNrA qKDuRtZqJzUJ46VOEjcwScBvTnQV9hUbMbRjxYdBKV+Y7k5gYMMwg7Z13vqsK/RvK5ZxNpWnbDX 8gU4= X-Google-Smtp-Source: AGHT+IED8xjKiEMzoCRjA4si8ogiY3dzI4tr+pfIjGKzy1ZaBtz6VDX64XzpenX/7vKF1wgXX3E8QA== X-Received: by 2002:a05:6a00:4b56:b0:71e:7174:3a6 with SMTP id d2e1a72fcca58-72413da856cmr30782892b3a.0.1731513394899; Wed, 13 Nov 2024 07:56:34 -0800 (PST) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-724078609f3sm13336442b3a.10.2024.11.13.07.56.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Nov 2024 07:56:34 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Kai Ji Subject: [PATCH] crypto/openssl: remove unneccessary null free checks Date: Wed, 13 Nov 2024 07:56:21 -0800 Message-ID: <20241113155622.12011-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 The function EVP_PKEY_CTX_free allows NULL parameter (similar to free()). Signed-off-by: Stephen Hemminger --- drivers/crypto/openssl/rte_openssl_pmd.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/crypto/openssl/rte_openssl_pmd.c b/drivers/crypto/openssl/rte_openssl_pmd.c index b2442c7ebf..d2cf20c059 100644 --- a/drivers/crypto/openssl/rte_openssl_pmd.c +++ b/drivers/crypto/openssl/rte_openssl_pmd.c @@ -3244,14 +3244,11 @@ process_openssl_eddsa_op_evp(struct rte_crypto_op *cop, err_eddsa: OSSL_PARAM_BLD_free(iparam_bld); - if (sctx) - EVP_PKEY_CTX_free(sctx); + EVP_PKEY_CTX_free(sctx); - if (cctx) - EVP_PKEY_CTX_free(cctx); + EVP_PKEY_CTX_free(cctx); - if (pkey) - EVP_PKEY_free(pkey); + EVP_PKEY_free(pkey); return ret; } -- 2.45.2