diff options
author | Dumitru Ceara <dceara@redhat.com> | 2021-05-25 17:16:25 +0200 |
---|---|---|
committer | Ilya Maximets <i.maximets@ovn.org> | 2021-06-03 12:41:55 +0200 |
commit | fe7bd42d6cad0cb1673019a9db01403461dbb7e7 (patch) | |
tree | b4a4e088348d9cb1f78a4257d4a998c70e710ce6 | |
parent | fc23134227f4977f5e0df06f05d114e711f3e056 (diff) | |
download | openvswitch-fe7bd42d6cad0cb1673019a9db01403461dbb7e7.tar.gz |
ofproto: Fix potential NULL dereference in ofproto_ct_*_zone_timeout_policy().
Spotted during code inspection.
Fixes: 993cae678bca ("ofproto-dpif: Consume CT_Zone, and CT_Timeout_Policy tables")
Signed-off-by: Dumitru Ceara <dceara@redhat.com>
Acked-by: Paolo Valerio <pvalerio@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
-rw-r--r-- | ofproto/ofproto.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c index 9523ba264..4e9569e4a 100644 --- a/ofproto/ofproto.c +++ b/ofproto/ofproto.c @@ -974,7 +974,7 @@ ofproto_ct_set_zone_timeout_policy(const char *datapath_type, uint16_t zone_id, datapath_type = ofproto_normalize_type(datapath_type); const struct ofproto_class *class = ofproto_class_find__(datapath_type); - if (class->ct_set_zone_timeout_policy) { + if (class && class->ct_set_zone_timeout_policy) { class->ct_set_zone_timeout_policy(datapath_type, zone_id, timeout_policy); } @@ -986,7 +986,7 @@ ofproto_ct_del_zone_timeout_policy(const char *datapath_type, uint16_t zone_id) datapath_type = ofproto_normalize_type(datapath_type); const struct ofproto_class *class = ofproto_class_find__(datapath_type); - if (class->ct_del_zone_timeout_policy) { + if (class && class->ct_del_zone_timeout_policy) { class->ct_del_zone_timeout_policy(datapath_type, zone_id); } |