[ovs-dev] [PATCH 05/15] ovsdb: Add default case to ovsdb_mutation_set_execute().

Ben Pfaff blp at nicira.com
Wed Feb 10 11:30:28 PST 2010


The value of 'error' is indeterminate if m->mutator is not set to a valid
value here, so we should add a default case to handle the exception.  It
shouldn't happen, of course.

Found by Clang (http://clang-analyzer.llvm.org/).
---
 ovsdb/mutation.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/ovsdb/mutation.c b/ovsdb/mutation.c
index bd6986d..72d7d0c 100644
--- a/ovsdb/mutation.c
+++ b/ovsdb/mutation.c
@@ -379,6 +379,9 @@ ovsdb_mutation_set_execute(struct ovsdb_row *row,
             ovsdb_datum_subtract(dst, dst_type, arg, arg_type);
             error = ovsdb_mutation_check_count(dst, dst_type);
             break;
+
+        default:
+            NOT_REACHED();
         }
         if (error) {
             return error;
-- 
1.6.6.1





More information about the dev mailing list