Skip to contentSkip to conversation

examples/vm_power_manager: fix unreachable code

PATCH Applied David Hunt 3 participants 3 messages Apr 10, 2019 – Apr 22, 2019

lore
Share & tools
lore

David Hunt

author
#0 lore raw

PATCH 1/1 examples/vm_power_manager: fix unreachable code

A for loop to MAX_VFS had a break as the last line, so the w++ would never get called, breaking out of the loop after the first iteration. Remove the break so that the loop can execute properly.

Fixes ace158c4a821 ("examples/vm_power: add check for port count")

Coverity issue: 337682

---
 examples/vm_power_manager/main.c | 1 -
 1 file changed, 1 deletion(-)
examples/vm_power_manager/main.c +0 -1
index 893bf4cdd..9b11f66f9 100644
@@ -390,7 +390,6 @@ main(int argc, char **argv)
 					break;
 				}
 				printf("\n");
-				break;
 			}
 		}
 	}
Signature · 1 line
2.17.1
#2 lore raw
Quoted 11 lines
Quoted 9 lines

A for loop to MAX_VFS had a break as the last line, so the w++ would never get called, breaking out of the loop after the first iteration. Remove the break so that the loop can execute properly.

Fixes ace158c4a821 ("examples/vm_power: add check for port count")

Coverity issue: 337682

Applied, thanks