Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 99a6993a authored by Jian Shen's avatar Jian Shen Committed by David S. Miller
Browse files

net: hns3: cleanup of return values in hclge_init_client_instance()



Removes the goto and directly returns in case of errors as part of the
cleanup.

Signed-off-by: default avatarJian Shen <shenjian15@huawei.com>
Signed-off-by: default avatarPeng Li <lipeng321@huawei.com>
Signed-off-by: default avatarSalil Mehta <salil.mehta@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e63cd65f
Loading
Loading
Loading
Loading
+6 −8
Original line number Diff line number Diff line
@@ -5297,7 +5297,7 @@ static int hclge_init_client_instance(struct hnae3_client *client,
			vport->nic.client = client;
			ret = client->ops->init_instance(&vport->nic);
			if (ret)
				goto err;
				return ret;

			if (hdev->roce_client &&
			    hnae3_dev_roce_supported(hdev)) {
@@ -5305,11 +5305,11 @@ static int hclge_init_client_instance(struct hnae3_client *client,

				ret = hclge_init_roce_base_info(vport);
				if (ret)
					goto err;
					return ret;

				ret = rc->ops->init_instance(&vport->roce);
				if (ret)
					goto err;
					return ret;
			}

			break;
@@ -5319,7 +5319,7 @@ static int hclge_init_client_instance(struct hnae3_client *client,

			ret = client->ops->init_instance(&vport->nic);
			if (ret)
				goto err;
				return ret;

			break;
		case HNAE3_CLIENT_ROCE:
@@ -5331,18 +5331,16 @@ static int hclge_init_client_instance(struct hnae3_client *client,
			if (hdev->roce_client && hdev->nic_client) {
				ret = hclge_init_roce_base_info(vport);
				if (ret)
					goto err;
					return ret;

				ret = client->ops->init_instance(&vport->roce);
				if (ret)
					goto err;
					return ret;
			}
		}
	}

	return 0;
err:
	return ret;
}

static void hclge_uninit_client_instance(struct hnae3_client *client,