All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] openvswitch: Fix memory leak in ovs_vport_alloc() error path
@ 2014-08-12  7:27 ` Christoph Jaeger
  0 siblings, 0 replies; 4+ messages in thread
From: Christoph Jaeger @ 2014-08-12  7:27 UTC (permalink / raw)
  To: pshelar, davem; +Cc: dev, netdev, linux-kernel, Christoph Jaeger

ovs_vport_alloc() bails out without freeing the memory 'vport' points to.

Picked up by Coverity - CID 1230503.

Fixes: 5cd667b0a4 ("openvswitch: Allow each vport to have an array of 'port_id's.")
Signed-off-by: Christoph Jaeger <cj@linux.com>
---
 net/openvswitch/vport.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/openvswitch/vport.c b/net/openvswitch/vport.c
index 702fb21..6d8f2ec 100644
--- a/net/openvswitch/vport.c
+++ b/net/openvswitch/vport.c
@@ -137,8 +137,10 @@ struct vport *ovs_vport_alloc(int priv_size, const struct vport_ops *ops,
 	vport->ops = ops;
 	INIT_HLIST_NODE(&vport->dp_hash_node);
 
-	if (ovs_vport_set_upcall_portids(vport, parms->upcall_portids))
+	if (ovs_vport_set_upcall_portids(vport, parms->upcall_portids)) {
+		kfree(vport);
 		return ERR_PTR(-EINVAL);
+	}
 
 	vport->percpu_stats = netdev_alloc_pcpu_stats(struct pcpu_sw_netstats);
 	if (!vport->percpu_stats) {
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] openvswitch: Fix memory leak in ovs_vport_alloc() error path
@ 2014-08-12  7:27 ` Christoph Jaeger
  0 siblings, 0 replies; 4+ messages in thread
From: Christoph Jaeger @ 2014-08-12  7:27 UTC (permalink / raw)
  To: pshelar-l0M0P4e3n4LQT0dZR+AlfA, davem-fT/PcQaiUtIeIZ0/mPfg9Q
  Cc: dev-yBygre7rU0TnMu66kgdUjQ, netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, Christoph Jaeger

ovs_vport_alloc() bails out without freeing the memory 'vport' points to.

Picked up by Coverity - CID 1230503.

Fixes: 5cd667b0a4 ("openvswitch: Allow each vport to have an array of 'port_id's.")
Signed-off-by: Christoph Jaeger <cj-vYTEC60ixJUAvxtiuMwx3w@public.gmane.org>
---
 net/openvswitch/vport.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/openvswitch/vport.c b/net/openvswitch/vport.c
index 702fb21..6d8f2ec 100644
--- a/net/openvswitch/vport.c
+++ b/net/openvswitch/vport.c
@@ -137,8 +137,10 @@ struct vport *ovs_vport_alloc(int priv_size, const struct vport_ops *ops,
 	vport->ops = ops;
 	INIT_HLIST_NODE(&vport->dp_hash_node);
 
-	if (ovs_vport_set_upcall_portids(vport, parms->upcall_portids))
+	if (ovs_vport_set_upcall_portids(vport, parms->upcall_portids)) {
+		kfree(vport);
 		return ERR_PTR(-EINVAL);
+	}
 
 	vport->percpu_stats = netdev_alloc_pcpu_stats(struct pcpu_sw_netstats);
 	if (!vport->percpu_stats) {
-- 
1.9.3

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] openvswitch: Fix memory leak in ovs_vport_alloc() error path
@ 2014-08-12 21:26   ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2014-08-12 21:26 UTC (permalink / raw)
  To: cj; +Cc: pshelar, dev, netdev, linux-kernel

From: Christoph Jaeger <cj@linux.com>
Date: Tue, 12 Aug 2014 09:27:57 +0200

> ovs_vport_alloc() bails out without freeing the memory 'vport' points to.
> 
> Picked up by Coverity - CID 1230503.
> 
> Fixes: 5cd667b0a4 ("openvswitch: Allow each vport to have an array of 'port_id's.")
> Signed-off-by: Christoph Jaeger <cj@linux.com>

Applied, thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] openvswitch: Fix memory leak in ovs_vport_alloc() error path
@ 2014-08-12 21:26   ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2014-08-12 21:26 UTC (permalink / raw)
  To: cj-vYTEC60ixJUAvxtiuMwx3w
  Cc: dev-yBygre7rU0TnMu66kgdUjQ, netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

From: Christoph Jaeger <cj-vYTEC60ixJUAvxtiuMwx3w@public.gmane.org>
Date: Tue, 12 Aug 2014 09:27:57 +0200

> ovs_vport_alloc() bails out without freeing the memory 'vport' points to.
> 
> Picked up by Coverity - CID 1230503.
> 
> Fixes: 5cd667b0a4 ("openvswitch: Allow each vport to have an array of 'port_id's.")
> Signed-off-by: Christoph Jaeger <cj-vYTEC60ixJUAvxtiuMwx3w@public.gmane.org>

Applied, thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-08-12 21:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-12  7:27 [PATCH] openvswitch: Fix memory leak in ovs_vport_alloc() error path Christoph Jaeger
2014-08-12  7:27 ` Christoph Jaeger
2014-08-12 21:26 ` David Miller
2014-08-12 21:26   ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.