From: Andre Bartke Date: Tue, 31 May 2011 19:03:56 +0000 (+0200) Subject: staging: intel_sst: Fix memory leak X-Git-Tag: MMI-PSA29.97-13-9~18845^2~524 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4b2b6d842ba174a32cc7ad3c4e97aa0cfcaa0be2;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git 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 --- 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;