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

Commit 111f2d15 authored by K. Y. Srinivasan's avatar K. Y. Srinivasan Committed by James Bottomley
Browse files

storvsc: Set the error code correctly in failure conditions



In the function storvsc_channel_init(), error code was not getting
set correctly in some of the failure cases. Fix this issue.

Signed-off-by: default avatarK. Y. Srinivasan <kys@microsoft.com>
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarJames Bottomley <JBottomley@Odin.com>
parent b95f5be0
Loading
Loading
Loading
Loading
+9 −3
Original line number Original line Diff line number Diff line
@@ -952,8 +952,10 @@ static int storvsc_channel_init(struct hv_device *device)
	}
	}


	if (vstor_packet->operation != VSTOR_OPERATION_COMPLETE_IO ||
	if (vstor_packet->operation != VSTOR_OPERATION_COMPLETE_IO ||
	    vstor_packet->status != 0)
	    vstor_packet->status != 0) {
		ret = -EINVAL;
		goto cleanup;
		goto cleanup;
	}




	for (i = 0; i < ARRAY_SIZE(vmstor_protocols); i++) {
	for (i = 0; i < ARRAY_SIZE(vmstor_protocols); i++) {
@@ -1032,8 +1034,10 @@ static int storvsc_channel_init(struct hv_device *device)
	}
	}


	if (vstor_packet->operation != VSTOR_OPERATION_COMPLETE_IO ||
	if (vstor_packet->operation != VSTOR_OPERATION_COMPLETE_IO ||
	    vstor_packet->status != 0)
	    vstor_packet->status != 0) {
		ret = -EINVAL;
		goto cleanup;
		goto cleanup;
	}


	/*
	/*
	 * Check to see if multi-channel support is there.
	 * Check to see if multi-channel support is there.
@@ -1070,8 +1074,10 @@ static int storvsc_channel_init(struct hv_device *device)
	}
	}


	if (vstor_packet->operation != VSTOR_OPERATION_COMPLETE_IO ||
	if (vstor_packet->operation != VSTOR_OPERATION_COMPLETE_IO ||
	    vstor_packet->status != 0)
	    vstor_packet->status != 0) {
		ret = -EINVAL;
		goto cleanup;
		goto cleanup;
	}


	if (process_sub_channels)
	if (process_sub_channels)
		handle_multichannel_storage(device, max_chns);
		handle_multichannel_storage(device, max_chns);