All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch 3/3 -next] tcm_vhost: call kfree() on an error path
@ 2012-07-12 14:48 ` Dan Carpenter
  0 siblings, 0 replies; 5+ messages in thread
From: Dan Carpenter @ 2012-07-12 14:48 UTC (permalink / raw)
  To: Michael S. Tsirkin, Nicholas Bellinger
  Cc: kernel-janitors, kvm, virtualization

There is a memory leak here.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/vhost/tcm_vhost.c b/drivers/vhost/tcm_vhost.c
index 57d39c5..29850cb 100644
--- a/drivers/vhost/tcm_vhost.c
+++ b/drivers/vhost/tcm_vhost.c
@@ -1420,6 +1420,7 @@ static struct se_wwn *tcm_vhost_make_tport(
 
 	pr_err("Unable to locate prefix for emulated Target Port:"
 			" %s\n", name);
+	kfree(tport);
 	return ERR_PTR(-EINVAL);
 
 check_len:

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

* [patch 3/3 -next] tcm_vhost: call kfree() on an error path
@ 2012-07-12 14:48 ` Dan Carpenter
  0 siblings, 0 replies; 5+ messages in thread
From: Dan Carpenter @ 2012-07-12 14:48 UTC (permalink / raw)
  To: Michael S. Tsirkin, Nicholas Bellinger
  Cc: kernel-janitors, kvm, virtualization

There is a memory leak here.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/vhost/tcm_vhost.c b/drivers/vhost/tcm_vhost.c
index 57d39c5..29850cb 100644
--- a/drivers/vhost/tcm_vhost.c
+++ b/drivers/vhost/tcm_vhost.c
@@ -1420,6 +1420,7 @@ static struct se_wwn *tcm_vhost_make_tport(
 
 	pr_err("Unable to locate prefix for emulated Target Port:"
 			" %s\n", name);
+	kfree(tport);
 	return ERR_PTR(-EINVAL);
 
 check_len:

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

* Re: [patch 3/3 -next] tcm_vhost: call kfree() on an error path
  2012-07-12 14:48 ` Dan Carpenter
@ 2012-07-12 21:49   ` Nicholas A. Bellinger
  -1 siblings, 0 replies; 5+ messages in thread
From: Nicholas A. Bellinger @ 2012-07-12 21:49 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Michael S. Tsirkin, kvm, virtualization, kernel-janitors, target-devel

On Thu, 2012-07-12 at 17:48 +0300, Dan Carpenter wrote:
> There is a memory leak here.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/drivers/vhost/tcm_vhost.c b/drivers/vhost/tcm_vhost.c
> index 57d39c5..29850cb 100644
> --- a/drivers/vhost/tcm_vhost.c
> +++ b/drivers/vhost/tcm_vhost.c
> @@ -1420,6 +1420,7 @@ static struct se_wwn *tcm_vhost_make_tport(
>  
>  	pr_err("Unable to locate prefix for emulated Target Port:"
>  			" %s\n", name);
> +	kfree(tport);
>  	return ERR_PTR(-EINVAL);
>  
>  check_len:

Applied to for-next-merge, and folding the series into the initial merge
commit now..

Thank you!

--nab


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

* Re: [patch 3/3 -next] tcm_vhost: call kfree() on an error path
@ 2012-07-12 21:49   ` Nicholas A. Bellinger
  0 siblings, 0 replies; 5+ messages in thread
From: Nicholas A. Bellinger @ 2012-07-12 21:49 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Michael S. Tsirkin, kvm, virtualization, kernel-janitors, target-devel

On Thu, 2012-07-12 at 17:48 +0300, Dan Carpenter wrote:
> There is a memory leak here.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/drivers/vhost/tcm_vhost.c b/drivers/vhost/tcm_vhost.c
> index 57d39c5..29850cb 100644
> --- a/drivers/vhost/tcm_vhost.c
> +++ b/drivers/vhost/tcm_vhost.c
> @@ -1420,6 +1420,7 @@ static struct se_wwn *tcm_vhost_make_tport(
>  
>  	pr_err("Unable to locate prefix for emulated Target Port:"
>  			" %s\n", name);
> +	kfree(tport);
>  	return ERR_PTR(-EINVAL);
>  
>  check_len:

Applied to for-next-merge, and folding the series into the initial merge
commit now..

Thank you!

--nab

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

* Re: [patch 3/3 -next] tcm_vhost: call kfree() on an error path
  2012-07-12 14:48 ` Dan Carpenter
  (?)
  (?)
@ 2012-07-12 21:49 ` Nicholas A. Bellinger
  -1 siblings, 0 replies; 5+ messages in thread
From: Nicholas A. Bellinger @ 2012-07-12 21:49 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: target-devel, virtualization, kernel-janitors, kvm, Michael S. Tsirkin

On Thu, 2012-07-12 at 17:48 +0300, Dan Carpenter wrote:
> There is a memory leak here.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/drivers/vhost/tcm_vhost.c b/drivers/vhost/tcm_vhost.c
> index 57d39c5..29850cb 100644
> --- a/drivers/vhost/tcm_vhost.c
> +++ b/drivers/vhost/tcm_vhost.c
> @@ -1420,6 +1420,7 @@ static struct se_wwn *tcm_vhost_make_tport(
>  
>  	pr_err("Unable to locate prefix for emulated Target Port:"
>  			" %s\n", name);
> +	kfree(tport);
>  	return ERR_PTR(-EINVAL);
>  
>  check_len:

Applied to for-next-merge, and folding the series into the initial merge
commit now..

Thank you!

--nab

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

end of thread, other threads:[~2012-07-12 21:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-12 14:48 [patch 3/3 -next] tcm_vhost: call kfree() on an error path Dan Carpenter
2012-07-12 14:48 ` Dan Carpenter
2012-07-12 21:49 ` Nicholas A. Bellinger
2012-07-12 21:49   ` Nicholas A. Bellinger
2012-07-12 21:49 ` Nicholas A. Bellinger

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.