Re: [ovs-dev] [PATCH] xcache: Handle null argument for xlate_cache_uninit().
> On Dec 21, 2017, at 10:05 AM, Yifeng Sunwrote: > > Thanks, looks good to me. > > Reviewed-by: Yifeng Sun Thanks. I pushed this with yours and Ben's acks. --Justin ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [PATCH] xcache: Handle null argument for xlate_cache_uninit().
On Wed, Dec 20, 2017 at 07:42:41PM -0800, Justin Pettit wrote: > Most other OVS libraries' delete and uninitialization functions allow a > null argument, but this one would cause a segfault. > > Signed-off-by: Justin PettitAcked-by: Ben Pfaff ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [PATCH] xcache: Handle null argument for xlate_cache_uninit().
Thanks, looks good to me. Reviewed-by: Yifeng SunOn Wed, Dec 20, 2017 at 7:42 PM, Justin Pettit wrote: > Most other OVS libraries' delete and uninitialization functions allow a > null argument, but this one would cause a segfault. > > Signed-off-by: Justin Pettit > --- > ofproto/ofproto-dpif-xlate-cache.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/ofproto/ofproto-dpif-xlate-cache.c > b/ofproto/ofproto-dpif-xlate-cache.c > index d319d287eadb..24fc769a7a0d 100644 > --- a/ofproto/ofproto-dpif-xlate-cache.c > +++ b/ofproto/ofproto-dpif-xlate-cache.c > @@ -279,6 +279,9 @@ xlate_cache_clear(struct xlate_cache *xcache) > void > xlate_cache_uninit(struct xlate_cache *xcache) > { > +if (!xcache) { > +return; > +} > xlate_cache_clear(xcache); > ofpbuf_uninit(>entries); > } > -- > 2.7.4 > > ___ > dev mailing list > d...@openvswitch.org > https://mail.openvswitch.org/mailman/listinfo/ovs-dev > ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
[ovs-dev] [PATCH] xcache: Handle null argument for xlate_cache_uninit().
Most other OVS libraries' delete and uninitialization functions allow a null argument, but this one would cause a segfault. Signed-off-by: Justin Pettit--- ofproto/ofproto-dpif-xlate-cache.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ofproto/ofproto-dpif-xlate-cache.c b/ofproto/ofproto-dpif-xlate-cache.c index d319d287eadb..24fc769a7a0d 100644 --- a/ofproto/ofproto-dpif-xlate-cache.c +++ b/ofproto/ofproto-dpif-xlate-cache.c @@ -279,6 +279,9 @@ xlate_cache_clear(struct xlate_cache *xcache) void xlate_cache_uninit(struct xlate_cache *xcache) { +if (!xcache) { +return; +} xlate_cache_clear(xcache); ofpbuf_uninit(>entries); } -- 2.7.4 ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev