summaryrefslogtreecommitdiff
path: root/ofproto/ofproto.c
diff options
context:
space:
mode:
authorDumitru Ceara <dceara@redhat.com>2021-05-25 17:16:12 +0200
committerIlya Maximets <i.maximets@ovn.org>2021-06-03 13:20:21 +0200
commitdd0f59783e397a6ffa03cc5bfc6f2182b0004f49 (patch)
tree8c6945e0874143fc989b3c2a2b2cf3b3546fd24c /ofproto/ofproto.c
parentf1951d41fb43eaacf3976ad1cf228b99df362a4b (diff)
downloadopenvswitch-dd0f59783e397a6ffa03cc5bfc6f2182b0004f49.tar.gz
ofproto: Fix potential NULL dereference in ofproto_get_datapath_cap().
Reproducer: ovs-vsctl \ -- add-br br \ -- set bridge br datapath-type=foo \ -- --id=@m create Datapath datapath_version=0 'capabilities={}' \ -- set Open_vSwitch . datapaths:"foo"=@m Fixes: 27501802d09f ("ofproto-dpif: Expose datapath capability to ovsdb.") Signed-off-by: Dumitru Ceara <dceara@redhat.com> Acked-by: Paolo Valerio <pvalerio@redhat.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Diffstat (limited to 'ofproto/ofproto.c')
-rw-r--r--ofproto/ofproto.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c
index b91517cd2..bf6a262be 100644
--- a/ofproto/ofproto.c
+++ b/ofproto/ofproto.c
@@ -968,7 +968,7 @@ ofproto_get_datapath_cap(const char *datapath_type, struct smap *dp_cap)
datapath_type = ofproto_normalize_type(datapath_type);
const struct ofproto_class *class = ofproto_class_find__(datapath_type);
- if (class->get_datapath_cap) {
+ if (class && class->get_datapath_cap) {
class->get_datapath_cap(datapath_type, dp_cap);
}
}