From 4b2b6d842ba174a32cc7ad3c4e97aa0cfcaa0be2 Mon Sep 17 00:00:00 2001 From: Andre Bartke Date: Tue, 31 May 2011 21:03:56 +0200 Subject: [PATCH] staging: intel_sst: Fix memory leak In case of an error stream_bufs is not freed here. Signed-off-by: Andre Bartke Acked-by: Alan Cox Signed-off-by: Greg Kroah-Hartman --- drivers/staging/intel_sst/intel_sst_app_interface.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/staging/intel_sst/intel_sst_app_interface.c b/drivers/staging/intel_sst/intel_sst_app_interface.c index b8c7ddbd7cf3..93b41a284d83 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; -- 2.20.1