aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/sw/siw/siw_qp.c
diff options
context:
space:
mode:
authorDoug Ledford <dledford@redhat.com>2019-07-29 13:38:42 -0400
committerDoug Ledford <dledford@redhat.com>2019-07-29 13:38:42 -0400
commit525a2c651cdd08b19a4c04f63b87e460765220ac (patch)
treead65ead1b0a281be08e5c47e2a7eb911dd0d2a9b /drivers/infiniband/sw/siw/siw_qp.c
parentIB/mlx5: Support per device q counters in switchdev mode (diff)
parentDo not dereference 'siw_crypto_shash' before checking (diff)
downloadlinux-dev-525a2c651cdd08b19a4c04f63b87e460765220ac.tar.xz
linux-dev-525a2c651cdd08b19a4c04f63b87e460765220ac.zip
Merge branch 'wip/dl-for-rc' into wip/dl-for-next
The fix for IB port statistics initialization ("IB/core: Fix querying total rdma stats") is needed before we take a follow-on patch to for-next. Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/sw/siw/siw_qp.c')
-rw-r--r--drivers/infiniband/sw/siw/siw_qp.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/infiniband/sw/siw/siw_qp.c b/drivers/infiniband/sw/siw/siw_qp.c
index 11383d9f95ef..e27bd5b35b96 100644
--- a/drivers/infiniband/sw/siw/siw_qp.c
+++ b/drivers/infiniband/sw/siw/siw_qp.c
@@ -220,12 +220,14 @@ static int siw_qp_enable_crc(struct siw_qp *qp)
{
struct siw_rx_stream *c_rx = &qp->rx_stream;
struct siw_iwarp_tx *c_tx = &qp->tx_ctx;
- int size = crypto_shash_descsize(siw_crypto_shash) +
- sizeof(struct shash_desc);
+ int size;
if (siw_crypto_shash == NULL)
return -ENOENT;
+ size = crypto_shash_descsize(siw_crypto_shash) +
+ sizeof(struct shash_desc);
+
c_tx->mpa_crc_hd = kzalloc(size, GFP_KERNEL);
c_rx->mpa_crc_hd = kzalloc(size, GFP_KERNEL);
if (!c_tx->mpa_crc_hd || !c_rx->mpa_crc_hd) {