All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: raeds@mellanox.com
Cc: Boris Pismenny <borisp@mellanox.com>, linux-rdma@vger.kernel.org
Subject: [bug report] net/mlx5: IPsec, Refactor SA handle creation and destruction
Date: Wed, 22 Apr 2020 11:46:34 +0300	[thread overview]
Message-ID: <20200422084634.GA190201@mwanda> (raw)

Hello Raed Salem,

The patch 7dfee4b1d79e: "net/mlx5: IPsec, Refactor SA handle creation
and destruction" from Oct 23, 2019, leads to the following static
checker warning:

	drivers/net/ethernet/mellanox/mlx5/core/fpga/ipsec.c:711 mlx5_fpga_ipsec_create_sa_ctx()
	warn: bitwise AND condition is false here

drivers/net/ethernet/mellanox/mlx5/core/fpga/ipsec.c
   701                             sizeof(sa_ctx->hw_sa))) {
   702                          context = ERR_PTR(-EINVAL);
   703                          goto exists;
   704                  }
   705  
   706                  ++fpga_xfrm->num_rules;
   707                  context = fpga_xfrm->sa_ctx;
   708                  goto exists;
   709          }
   710  
   711          if (accel_xfrm->attrs.action & MLX5_ACCEL_ESP_ACTION_DECRYPT) {
                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This is zero and it's always used like this, so it can never be true.

drivers/net/ethernet/mellanox/mlx5/core/fpga/ipsec.c:762 mlx5_fpga_ipsec_create_sa_ctx() warn: bitwise AND condition is false here
drivers/net/ethernet/mellanox/mlx5/core/fpga/ipsec.c:856 mlx5_fpga_ipsec_release_sa_ctx() warn: bitwise AND condition is false here

   712                  err = ida_simple_get(&fipsec->halloc, 1, 0, GFP_KERNEL);
   713                  if (err < 0) {
   714                          context = ERR_PTR(err);
   715                          goto exists;
   716                  }
   717  
   718                  sa_ctx->sa_handle = err;
   719                  if (sa_handle)
   720                          *sa_handle = sa_ctx->sa_handle;
   721          }
   722          /* This is unbounded fpga_xfrm, try to add to hash */
   723          mutex_lock(&fipsec->sa_hash_lock);
   724  
   725          err = rhashtable_lookup_insert_fast(&fipsec->sa_hash, &sa_ctx->hash,

regards,
dan carpenter

                 reply	other threads:[~2020-04-22  8:46 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200422084634.GA190201@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=borisp@mellanox.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=raeds@mellanox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.