diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2014-08-22 08:19:44 -0400 |
---|---|---|
committer | Vinod Koul <vinod.koul@intel.com> | 2014-09-23 11:20:39 -0400 |
commit | c2e6f424a4abc9bb561133b00b2134ce11be34e9 (patch) | |
tree | b6e2fa67247c3aeb42adcc7777d99033f1f3ebf6 /drivers/dma | |
parent | d9ff958bb34aabdce08d11b0db24123c093d87cd (diff) |
dmatest: prevent memory leakage on error path in thread
When we fail to allocate memory for thread->srcs or thread->dsts and src_cnt or
dst_cnt great than 1 we leak memory on error path. This patch fixes the issue.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'drivers/dma')
-rw-r--r-- | drivers/dma/dmatest.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/dma/dmatest.c b/drivers/dma/dmatest.c index e27cec25c59e..a8d7809e2f4c 100644 --- a/drivers/dma/dmatest.c +++ b/drivers/dma/dmatest.c | |||
@@ -688,14 +688,14 @@ static int dmatest_func(void *data) | |||
688 | runtime = ktime_us_delta(ktime_get(), ktime); | 688 | runtime = ktime_us_delta(ktime_get(), ktime); |
689 | 689 | ||
690 | ret = 0; | 690 | ret = 0; |
691 | err_dstbuf: | ||
691 | for (i = 0; thread->dsts[i]; i++) | 692 | for (i = 0; thread->dsts[i]; i++) |
692 | kfree(thread->dsts[i]); | 693 | kfree(thread->dsts[i]); |
693 | err_dstbuf: | ||
694 | kfree(thread->dsts); | 694 | kfree(thread->dsts); |
695 | err_dsts: | 695 | err_dsts: |
696 | err_srcbuf: | ||
696 | for (i = 0; thread->srcs[i]; i++) | 697 | for (i = 0; thread->srcs[i]; i++) |
697 | kfree(thread->srcs[i]); | 698 | kfree(thread->srcs[i]); |
698 | err_srcbuf: | ||
699 | kfree(thread->srcs); | 699 | kfree(thread->srcs); |
700 | err_srcs: | 700 | err_srcs: |
701 | kfree(pq_coefs); | 701 | kfree(pq_coefs); |