All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andre Bartke <andre.bartke@googlemail.com>
To: gregkh@suse.de
Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
	Andre Bartke <andre.bartke@gmail.com>
Subject: [PATCH] staging: intel_sst: Fix memory leak
Date: Tue, 31 May 2011 21:03:56 +0200	[thread overview]
Message-ID: <1306868636-23367-1-git-send-email-andre.bartke@gmail.com> (raw)

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


             reply	other threads:[~2011-05-31 19:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-31 19:03 Andre Bartke [this message]
2011-05-31 22:42 ` [PATCH] staging: intel_sst: Fix memory leak 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1306868636-23367-1-git-send-email-andre.bartke@gmail.com \
    --to=andre.bartke@googlemail.com \
    --cc=andre.bartke@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.