From: Justin Pettit Date: Sat, 13 Sep 2008 01:47:29 +0000 (-0700) Subject: Fix crash when no actions are specified. X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=6114ad11bbd22c709fc7588d1f2b82f73b5a6923;p=sliver-openvswitch.git Fix crash when no actions are specified. Actions are allocated as a pointer to an array of actions in flows. When flows are freed, the code was always freeing the action pointer. Under some circumstances the pointer may not be set. --- diff --git a/datapath/flow.c b/datapath/flow.c index a2c96abd6..71dd8235d 100644 --- a/datapath/flow.c +++ b/datapath/flow.c @@ -187,7 +187,8 @@ void flow_free(struct sw_flow *flow) { if (unlikely(!flow)) return; - kfree(flow->actions); + if (flow->actions) + kfree(flow->actions); kmem_cache_free(flow_cache, flow); } EXPORT_SYMBOL(flow_free); diff --git a/switch/switch-flow.c b/switch/switch-flow.c index 9c9538d0e..16a7177e1 100644 --- a/switch/switch-flow.c +++ b/switch/switch-flow.c @@ -191,7 +191,9 @@ flow_free(struct sw_flow *flow) if (!flow) { return; } - free(flow->actions); + if (flow->actions) { + free(flow->actions); + } free(flow); }