summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorChristophe Jaillet <christophe.jaillet@wanadoo.fr>2017-07-16 13:09:23 +0200
committerDoug Ledford <dledford@redhat.com>2017-08-18 14:01:08 -0400
commit02654b5ae1a45c0e31060816231086685cfcd841 (patch)
treef638f4350e49026ff2c67e8cb92ef0fe0b68336b /drivers
parent7806def081b2185a488fb31bd1deb4f5a3fe4765 (diff)
downloadlinux-stable-02654b5ae1a45c0e31060816231086685cfcd841.tar.gz
linux-stable-02654b5ae1a45c0e31060816231086685cfcd841.tar.bz2
linux-stable-02654b5ae1a45c0e31060816231086685cfcd841.zip
i40iw: Simplify code
Axe a few lines of code and re-use existing error handling path to avoid code duplication. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Acked-by: Shiraz Saleem <shiraz.saleem@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/infiniband/hw/i40iw/i40iw_pble.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/infiniband/hw/i40iw/i40iw_pble.c b/drivers/infiniband/hw/i40iw/i40iw_pble.c
index c87ba1617087..540aab5e502d 100644
--- a/drivers/infiniband/hw/i40iw/i40iw_pble.c
+++ b/drivers/infiniband/hw/i40iw/i40iw_pble.c
@@ -269,10 +269,8 @@ static enum i40iw_status_code add_bp_pages(struct i40iw_sc_dev *dev,
status = i40iw_add_sd_table_entry(dev->hw, hmc_info,
info->idx.sd_idx, I40IW_SD_TYPE_PAGED,
I40IW_HMC_DIRECT_BP_SIZE);
- if (status) {
- i40iw_free_vmalloc_mem(dev->hw, chunk);
- return status;
- }
+ if (status)
+ goto error;
if (!dev->is_pf) {
status = i40iw_vchnl_vf_add_hmc_objs(dev, I40IW_HMC_IW_PBLE,
fpm_to_idx(pble_rsrc,
@@ -280,8 +278,7 @@ static enum i40iw_status_code add_bp_pages(struct i40iw_sc_dev *dev,
(info->pages << PBLE_512_SHIFT));
if (status) {
i40iw_pr_err("allocate PBLEs in the PF. Error %i\n", status);
- i40iw_free_vmalloc_mem(dev->hw, chunk);
- return status;
+ goto error;
}
}
addr = chunk->vaddr;