datapath: Fix read of uninitialized data.
authorBen Pfaff <blp@nicira.com>
Wed, 27 May 2009 16:09:54 +0000 (09:09 -0700)
committerBen Pfaff <blp@nicira.com>
Wed, 27 May 2009 16:09:54 +0000 (09:09 -0700)
Control jumps to the error_free_flow label to free a flow allocated with
kmem_cache_alloc(), but the sf_acts member of that flow has never been
initialized and thus flow_free() will pass uninitialized data to kfree().
Fix it by just freeing the flow itself.

datapath/datapath.c

index d4dac8561943d967bf8c65390d31d484e7a72c25..e6484ac73cf9cd99fa17009dbe49b718176994ce 100644 (file)
@@ -932,7 +932,7 @@ retry:
        return 0;
 
 error_free_flow:
-       flow_free(flow);
+       kmem_cache_free(flow_cache, flow);
 error:
        return error;
 }