Commit a661b43f authored by Wei Yongjun's avatar Wei Yongjun Committed by David S. Miller

mlx5: fix error return code in mlx5_alloc_uuars()

Fix to return -ENOMEM from the ioremap error handling
case instead of 0, as done elsewhere in this function.
Signed-off-by: default avatarWei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5445eaf3
...@@ -164,6 +164,7 @@ int mlx5_alloc_uuars(struct mlx5_core_dev *dev, struct mlx5_uuar_info *uuari) ...@@ -164,6 +164,7 @@ int mlx5_alloc_uuars(struct mlx5_core_dev *dev, struct mlx5_uuar_info *uuari)
uuari->uars[i].map = ioremap(addr, PAGE_SIZE); uuari->uars[i].map = ioremap(addr, PAGE_SIZE);
if (!uuari->uars[i].map) { if (!uuari->uars[i].map) {
mlx5_cmd_free_uar(dev, uuari->uars[i].index); mlx5_cmd_free_uar(dev, uuari->uars[i].index);
err = -ENOMEM;
goto out_count; goto out_count;
} }
mlx5_core_dbg(dev, "allocated uar index 0x%x, mmaped at %p\n", mlx5_core_dbg(dev, "allocated uar index 0x%x, mmaped at %p\n",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment