Skip to content

Commit

Permalink
ofproto: Fix potential NULL dereference in ofproto_ct_*_zone_timeout_…
Browse files Browse the repository at this point in the history
…policy().

Spotted during code inspection.

Fixes: 993cae6 ("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>
  • Loading branch information
dceara authored and igsilya committed Jun 3, 2021
1 parent dd0f597 commit a4b0427
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ofproto/ofproto.c
Expand Up @@ -981,7 +981,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);
}
Expand All @@ -993,7 +993,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);
}

Expand Down

0 comments on commit a4b0427

Please sign in to comment.