From: Wei Yongjun Date: Mon, 29 Jul 2013 23:57:06 +0000 (+0800) Subject: mlx5: fix error return code in mlx5_alloc_uuars() X-Git-Tag: v3.11-rc4~22^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a661b43fd047ef501da43a19975415f861c7c3db;p=profile%2Fcommon%2Fkernel-common.git 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: Wei Yongjun Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/mellanox/mlx5/core/uar.c b/drivers/net/ethernet/mellanox/mlx5/core/uar.c index 71d4a39..68f5d9c 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/uar.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/uar.c @@ -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); if (!uuari->uars[i].map) { mlx5_cmd_free_uar(dev, uuari->uars[i].index); + err = -ENOMEM; goto out_count; } mlx5_core_dbg(dev, "allocated uar index 0x%x, mmaped at %p\n",