[libvirt] [PATCH 2/9] lxc: Add coverity[dead_error_begin] tag in switch stmts

John Ferlan jferlan at redhat.com
Tue Jan 22 14:40:57 UTC 2013


The use of switch statements inside a bounded for loop resulted in some
false positives regarding the "default:" label which cannot be reached
since each of the other case statements use the possible for loop values.
---
 src/lxc/lxc_driver.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index 3268e22..70b4f52 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -920,6 +920,7 @@ lxcDomainGetMemoryParameters(virDomainPtr dom,
                 goto cleanup;
             break;
 
+        /* coverity[dead_error_begin] */
         default:
             break;
             /* should not hit here */
@@ -2175,6 +2176,7 @@ lxcDomainGetBlkioParameters(virDomainPtr dom,
                     goto cleanup;
                 break;
 
+            /* coverity[dead_error_begin] */
             default:
                 break;
                 /* should not hit here */
@@ -2192,6 +2194,7 @@ lxcDomainGetBlkioParameters(virDomainPtr dom,
                     goto cleanup;
                 break;
 
+            /* coverity[dead_error_begin] */
             default:
                 break;
                 /* should not hit here */
-- 
1.7.11.7




More information about the libvir-list mailing list