Re: [ovs-dev] [PATCH] xcache: Handle null argument for xlate_cache_uninit().

2017-12-21 Thread Justin Pettit

> On Dec 21, 2017, at 10:05 AM, Yifeng Sun  wrote:
> 
> 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().

2017-12-21 Thread Ben Pfaff
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 Pettit 

Acked-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().

2017-12-21 Thread Yifeng Sun
Thanks, looks good to me.

Reviewed-by: Yifeng Sun 


On 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().

2017-12-20 Thread Justin Pettit
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