staging: intel_sst: Fix memory leak
authorAndre Bartke <andre.bartke@googlemail.com>
Tue, 31 May 2011 19:03:56 +0000 (21:03 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 28 Jun 2011 20:27:19 +0000 (13:27 -0700)
In case of an error stream_bufs is not freed here.

Signed-off-by: Andre Bartke <andre.bartke@gmail.com>
Acked-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/intel_sst/intel_sst_app_interface.c

index b8c7ddb..93b41a2 100644 (file)
@@ -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;