Fix: handle default switch case with -EINVAL in __lttng_counter_add
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 30 Nov 2020 19:09:31 +0000 (14:09 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 30 Nov 2020 19:09:31 +0000 (14:09 -0500)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
include/counter/counter-api.h

index 02d709a1e3dd6ca74a9c0fea9bba2e4e4b58597f..12520445fb30a8538ac1f958ce955149916ffcda 100644 (file)
@@ -80,6 +80,8 @@ static inline int __lttng_counter_add(const struct lib_counter_config *config,
                        } while (old != res);
                        break;
                }
+               default:
+                       return -EINVAL;
                }
                if (v > 0 && (v >= U8_MAX || n < old))
                        overflow = true;
@@ -119,6 +121,8 @@ static inline int __lttng_counter_add(const struct lib_counter_config *config,
                        } while (old != res);
                        break;
                }
+               default:
+                       return -EINVAL;
                }
                if (v > 0 && (v >= U16_MAX || n < old))
                        overflow = true;
@@ -158,6 +162,8 @@ static inline int __lttng_counter_add(const struct lib_counter_config *config,
                        } while (old != res);
                        break;
                }
+               default:
+                       return -EINVAL;
                }
                if (v > 0 && (v >= U32_MAX || n < old))
                        overflow = true;
@@ -198,6 +204,8 @@ static inline int __lttng_counter_add(const struct lib_counter_config *config,
                        } while (old != res);
                        break;
                }
+               default:
+                       return -EINVAL;
                }
                if (v > 0 && n < old)
                        overflow = true;
This page took 0.028321 seconds and 4 git commands to generate.