From patchwork Fri Aug 4 16:41:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 129914 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E9FD142FD6; Fri, 4 Aug 2023 18:42:14 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DDDD643247; Fri, 4 Aug 2023 18:42:10 +0200 (CEST) Received: from mail-pf1-f176.google.com (mail-pf1-f176.google.com [209.85.210.176]) by mails.dpdk.org (Postfix) with ESMTP id A600240EE1 for ; Fri, 4 Aug 2023 18:42:09 +0200 (CEST) Received: by mail-pf1-f176.google.com with SMTP id d2e1a72fcca58-686b91c2744so1705450b3a.0 for ; Fri, 04 Aug 2023 09:42:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20221208.gappssmtp.com; s=20221208; t=1691167328; x=1691772128; 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=DSV+SsTo/8KBtkmUplEZqD7+GIgTAYMHWPBS5sHOQkE=; b=LLMklf4AfnbFeZRxmEFzuHrJweb1kRvSPOxOTWnnStA+Q9H3ws6zSQWNpnCHSWgWb7 v273FKqW07bQyLPpdGhUeYVM3E+li9fUKfeOILuc8kEWHA7/S14ORkipS+x55i/bfJCR V6AXgC2pF/RQMUBNJ/WbdABvO49Zbh9atuGVxjRLoHsPRvTy0MAasFz+8R1o4qCx+ndo UV1hmb7+YkqXlC5HQ7tHdLZbFR6h+n4z9bKIC3LfHIirzsxsmI1OHnijnftaBPNsUJg0 MMkYzdfQU4yt17lYd43mr0aY3nTMOierXUsSi/NTpfcwQuKVA3GRpC0+YOb8Bx4ll6Rp JBpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691167328; x=1691772128; 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=DSV+SsTo/8KBtkmUplEZqD7+GIgTAYMHWPBS5sHOQkE=; b=Po203pAx6r31fyNJmbb1Sc7xOjPba3xoujUdp4Z08Eu9ha35pEloXpml5AgvCXO+MW QwQ9f/zjhE4r+R+WmOqb9DsR6PXeqNMTmDMmP5JrUmADiuFmggbImZXda/kKG1n93CUy G28eeKjTGPC6DYDRlti4tHUnPEiTf5tPCssLUZ6J5lI9/jghsq6wV4oyVHoixmOtfFpT +aJsZaiojT2/lFzbzmBpI6L99NZcfKGK96N0xpvSZWyVowBtl7ltGn0H1g9zD+HN2y0f dZdCExtvExiWJXIJ/iOXQBC6yHjhrZbEHYXOPkgS9OPRxi6NlYxaIrpRyJXg5ez8p5jd 5pQw== X-Gm-Message-State: AOJu0Ywal7pOzuQ3ln5ubXUxPdQJPZU+LGNNS/Vwvob57/AEpgaYb/Mr BDVb/uJCwa7+5zfCSB0fixIc6sje42MFQonYyKbtRg== X-Google-Smtp-Source: AGHT+IGMj25kWAWmWnHkfog4wMrGXqlOBTPWbhNWq1YlTGLki+9ocLPlCGyMZbUNRo1NJAMM0hUW7A== X-Received: by 2002:a05:6a00:2e0f:b0:687:3f06:5939 with SMTP id fc15-20020a056a002e0f00b006873f065939mr2498902pfb.32.1691167328644; Fri, 04 Aug 2023 09:42:08 -0700 (PDT) Received: from hermes.local (204-195-127-207.wavecable.com. [204.195.127.207]) by smtp.gmail.com with ESMTPSA id k188-20020a633dc5000000b0056420d3cd20sm1361356pga.71.2023.08.04.09.42.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Aug 2023 09:42:08 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Ajit Khaparde , Somnath Kotur Subject: [PATCH 2/2] net/bnxt: remove unnecessary check for null before free Date: Fri, 4 Aug 2023 09:41:56 -0700 Message-Id: <20230804164156.118331-2-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230804164156.118331-1-stephen@networkplumber.org> References: <20230804164156.118331-1-stephen@networkplumber.org> MIME-Version: 1.0 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 to check for null pointer before calling rte_free(). Found by cocci/nullfree.cocci script. Signed-off-by: Stephen Hemminger --- drivers/net/bnxt/bnxt_ethdev.c | 3 +-- drivers/net/bnxt/bnxt_vnic.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index ee1552452a11..ec8e441a6d05 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -6002,8 +6002,7 @@ static void bnxt_free_ctx_mem_buf(struct bnxt_ctx_mem_buf_info *ctx) if (!ctx) return; - if (ctx->va) - rte_free(ctx->va); + rte_free(ctx->va); ctx->va = NULL; ctx->dma = RTE_BAD_IOVA; diff --git a/drivers/net/bnxt/bnxt_vnic.c b/drivers/net/bnxt/bnxt_vnic.c index 2be456956ddc..f86d27fd7965 100644 --- a/drivers/net/bnxt/bnxt_vnic.c +++ b/drivers/net/bnxt/bnxt_vnic.c @@ -847,8 +847,7 @@ bnxt_vnic_rss_hash_algo_update(struct bnxt *bp, int32_t bnxt_vnic_queue_db_deinit(struct bnxt *bp) { - if (bp->vnic_queue_db.rss_q_db != NULL) - rte_hash_free(bp->vnic_queue_db.rss_q_db); + rte_hash_free(bp->vnic_queue_db.rss_q_db); return 0; }