mirror of
https://github.com/openvswitch/ovs
synced 2025-08-22 01:51:26 +00:00
ovsdb: Fix Clang's static analyzer 'func null dereference' warnings.
In the existing code, there is no existing path that would result in a crash. Therefore, this code is currently implemented to satisfy Clang's requirements. Nevertheless, it serves the additional purpose of preventing issues with potential new use cases of the ovsdb_mutation_set_execute() API. Signed-off-by: Eelco Chaudron <echaudro@redhat.com> Acked-by: Ilya Maximets <i.maximets@ovn.org> Signed-off-by: Simon Horman <horms@ovn.org>
This commit is contained in:
parent
03c8e8010e
commit
979bc94b1b
@ -236,7 +236,8 @@ ovsdb_mutation_set_destroy(struct ovsdb_mutation_set *set)
|
||||
enum ovsdb_mutation_scalar_error {
|
||||
ME_OK,
|
||||
ME_DOM,
|
||||
ME_RANGE
|
||||
ME_RANGE,
|
||||
ME_NOTSUP
|
||||
};
|
||||
|
||||
struct ovsdb_scalar_mutation {
|
||||
@ -267,6 +268,9 @@ ovsdb_mutation_scalar_error(enum ovsdb_mutation_scalar_error error,
|
||||
"Result of \"%s\" operation is out of range.",
|
||||
ovsdb_mutator_to_string(mutator));
|
||||
|
||||
case ME_NOTSUP:
|
||||
return ovsdb_error(NULL, "Operation not supported.");
|
||||
|
||||
default:
|
||||
return OVSDB_BUG("unexpected error");
|
||||
}
|
||||
@ -514,6 +518,12 @@ div_double(double *x, double y)
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
mod_double(double *x OVS_UNUSED, double y OVS_UNUSED)
|
||||
{
|
||||
return ME_NOTSUP;
|
||||
}
|
||||
|
||||
static const struct ovsdb_scalar_mutation add_mutation = {
|
||||
add_int, add_double, OVSDB_M_ADD
|
||||
};
|
||||
@ -531,5 +541,5 @@ static const struct ovsdb_scalar_mutation div_mutation = {
|
||||
};
|
||||
|
||||
static const struct ovsdb_scalar_mutation mod_mutation = {
|
||||
mod_int, NULL, OVSDB_M_MOD
|
||||
mod_int, mod_double, OVSDB_M_MOD
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user