All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: intel_sst: Fix memory leak
@ 2011-05-31 19:03 Andre Bartke
  2011-05-31 22:42 ` Dan Carpenter
  2011-06-01 12:50 ` Alan Cox
  0 siblings, 2 replies; 6+ messages in thread
From: Andre Bartke @ 2011-05-31 19:03 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel, Andre Bartke

In case of an error stream_bufs is not freed here.

Signed-off-by: Andre Bartke <andre.bartke@gmail.com>
---
 .../staging/intel_sst/intel_sst_app_interface.c    |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/intel_sst/intel_sst_app_interface.c b/drivers/staging/intel_sst/intel_sst_app_interface.c
index b8c7ddb..93b41a2 100644
--- a/drivers/staging/intel_sst/intel_sst_app_interface.c
+++ b/drivers/staging/intel_sst/intel_sst_app_interface.c
@@ -430,8 +430,10 @@ static int snd_sst_fill_kernel_list(struct stream_info *stream,
 				return -ENOMEM;
 			if (copy_from_user((void *) &rar_handle,
 					iovec[index].iov_base,
-					sizeof(__u32)))
+					sizeof(__u32))) {
+				kfree(stream_bufs);
 				return -EFAULT;
+			}
 			stream_bufs->addr = (char *)rar_handle;
 			stream_bufs->in_use = false;
 			stream_bufs->size = iovec[0].iov_len;
-- 
1.7.5.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread
* [patch] Staging: intel_sst: fix memory leak
@ 2010-11-13  8:58 Dan Carpenter
  2010-11-15  5:47 ` Harsha, Priya
  2010-11-16 13:38 ` Alan Cox
  0 siblings, 2 replies; 6+ messages in thread
From: Dan Carpenter @ 2010-11-13  8:58 UTC (permalink / raw)
  To: kernel-janitors

The original code set "str_info->decode_ibuf" to NULL so the kfree() is
no-op.

Signed-off-by: Dan Carpenter <error27@gmail.com>
---
This is a static checker thing.  I don't have the hardware to test this
myself so please check it carefully.

diff --git a/drivers/staging/intel_sst/intel_sst_stream_encoded.c b/drivers/staging/intel_sst/intel_sst_stream_encoded.c
index d4e94f1..09993d6 100644
--- a/drivers/staging/intel_sst/intel_sst_stream_encoded.c
+++ b/drivers/staging/intel_sst/intel_sst_stream_encoded.c
@@ -1270,7 +1270,7 @@ finish:
 	dbufs->output_bytes_produced = total_output;
 	str_info->status = str_info->prev;
 	str_info->prev = STREAM_DECODE;
-	str_info->decode_ibuf = NULL;
 	kfree(str_info->decode_ibuf);
+	str_info->decode_ibuf = NULL;
 	return retval;
 }

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

end of thread, other threads:[~2011-06-01 12:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-31 19:03 [PATCH] staging: intel_sst: Fix memory leak Andre Bartke
2011-05-31 22:42 ` Dan Carpenter
2011-06-01 12:50 ` Alan Cox
  -- strict thread matches above, loose matches on Subject: below --
2010-11-13  8:58 [patch] Staging: intel_sst: fix " Dan Carpenter
2010-11-15  5:47 ` Harsha, Priya
2010-11-16 13:38 ` Alan Cox

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.