datapath: Use kmem_cache_free() instead of kfree()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Wed, 8 Jan 2014 14:07:52 +0000 (06:07 -0800)
committerJesse Gross <jesse@nicira.com>
Wed, 8 Jan 2014 14:10:55 +0000 (06:10 -0800)
memory allocated by kmem_cache_alloc() should be freed using
kmem_cache_free(), not kfree().

Fixes: e298e5057006 ('openvswitch: Per cpu flow stats.')
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Jesse Gross <jesse@nicira.com>
datapath/flow_table.c

index cc0a8e4..4232b82 100644 (file)
@@ -106,7 +106,7 @@ struct sw_flow *ovs_flow_alloc(bool percpu_stats)
        }
        return flow;
 err:
-       kfree(flow);
+       kmem_cache_free(flow_cache, flow);
        return ERR_PTR(-ENOMEM);
 }