drivers: hv: Fix missing error code in vmbus_connect()
Subsystems (2)
PATCH 1/1 drivers: hv: Fix missing error code in vmbus_connect()
Eliminate the follow smatch warning:
drivers/hv/connection.c:236 vmbus_connect() warn: missing error code 'ret'.
--- drivers/hv/connection.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/hv/connection.c +3 -1
@@ -232,8 +232,10 @@ int vmbus_connect(void)*/ for (i =0 ; ; i++) { -if (i ==ARRAY_SIZE (vmbus_versions)) +if (i ==ARRAY_SIZE (vmbus_versions)) { + ret = -EDOM ; goto cleanup; + } version = vmbus_versions[i];if (version > max_version)
Signature · 1 line
1.8.3.1
From: Jiapeng Chong <[email protected]> Sent: Tuesday, May 25, 2021 3:59 AM
Quoted 29 lines
Eliminate the follow smatch warning:
drivers/hv/connection.c:236vmbus_connect()warn: missing error code 'ret'.Reported-by Abaci Robot <[email protected]>Signed-off-by Jiapeng Chong <[email protected]>--- drivers/hv/connection.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/hv/connection.c +3
-2@@ -232,8 +232,10 @@ int vmbus_connect(void)*/ for (i =0 ; ; i++) { -if (i ==ARRAY_SIZE (vmbus_versions)) +if (i ==ARRAY_SIZE (vmbus_versions)) { + ret = -EDOM ; goto cleanup; + } version = vmbus_versions[i];if (version > max_version) --
Quoted 1 line
1.8.3.1
I might have used -EINVAL instead of -EDOM as the error return value, but it really doesn't matter, and having a return value that is unique in the function might be helpful.
Quoted 36 lines · Michael Kelley
From: Jiapeng Chong <[email protected]> Sent: Tuesday, May 25, 2021 3:59 AM
Quoted 29 lines
Eliminate the follow smatch warning:
drivers/hv/connection.c:236vmbus_connect()warn: missing error code 'ret'.Reported-by Abaci Robot <[email protected]>Signed-off-by Jiapeng Chong <[email protected]>--- drivers/hv/connection.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/hv/connection.c +3
-2@@ -232,8 +232,10 @@ int vmbus_connect(void)*/ for (i =0 ; ; i++) { -if (i ==ARRAY_SIZE (vmbus_versions)) +if (i ==ARRAY_SIZE (vmbus_versions)) { + ret = -EDOM ; goto cleanup; + } version = vmbus_versions[i];if (version > max_version) --Quoted 1 line
1.8.3.1
I might have used
-EINVALinstead of-EDOMas the error return value, but it really doesn't matter, and having a return value that is unique in the function might be helpful.
Quoted 1 line
Reviewed-by Michael Kelley <[email protected]>
Applied to hyperv-fixes. Thanks.