diff options
-rw-r--r-- | drivers/net/mlx4/mr.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/drivers/net/mlx4/mr.c b/drivers/net/mlx4/mr.c index 679dfdb6807f..79b317b88c86 100644 --- a/drivers/net/mlx4/mr.c +++ b/drivers/net/mlx4/mr.c | |||
@@ -578,13 +578,6 @@ int mlx4_fmr_alloc(struct mlx4_dev *dev, u32 pd, u32 access, int max_pages, | |||
578 | goto err_free; | 578 | goto err_free; |
579 | } | 579 | } |
580 | 580 | ||
581 | fmr->mpt = mlx4_table_find(&priv->mr_table.dmpt_table, | ||
582 | key_to_hw_index(fmr->mr.key), NULL); | ||
583 | if (!fmr->mpt) { | ||
584 | err = -ENOMEM; | ||
585 | goto err_free; | ||
586 | } | ||
587 | |||
588 | return 0; | 581 | return 0; |
589 | 582 | ||
590 | err_free: | 583 | err_free: |
@@ -595,7 +588,19 @@ EXPORT_SYMBOL_GPL(mlx4_fmr_alloc); | |||
595 | 588 | ||
596 | int mlx4_fmr_enable(struct mlx4_dev *dev, struct mlx4_fmr *fmr) | 589 | int mlx4_fmr_enable(struct mlx4_dev *dev, struct mlx4_fmr *fmr) |
597 | { | 590 | { |
598 | return mlx4_mr_enable(dev, &fmr->mr); | 591 | struct mlx4_priv *priv = mlx4_priv(dev); |
592 | int err; | ||
593 | |||
594 | err = mlx4_mr_enable(dev, &fmr->mr); | ||
595 | if (err) | ||
596 | return err; | ||
597 | |||
598 | fmr->mpt = mlx4_table_find(&priv->mr_table.dmpt_table, | ||
599 | key_to_hw_index(fmr->mr.key), NULL); | ||
600 | if (!fmr->mpt) | ||
601 | return -ENOMEM; | ||
602 | |||
603 | return 0; | ||
599 | } | 604 | } |
600 | EXPORT_SYMBOL_GPL(mlx4_fmr_enable); | 605 | EXPORT_SYMBOL_GPL(mlx4_fmr_enable); |
601 | 606 | ||