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>
This commit is contained in:
parent
d9ff958bb3
commit
c2e6f424a4
1 changed files with 2 additions and 2 deletions
|
@ -688,14 +688,14 @@ static int dmatest_func(void *data)
|
||||||
runtime = ktime_us_delta(ktime_get(), ktime);
|
runtime = ktime_us_delta(ktime_get(), ktime);
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
err_dstbuf:
|
||||||
for (i = 0; thread->dsts[i]; i++)
|
for (i = 0; thread->dsts[i]; i++)
|
||||||
kfree(thread->dsts[i]);
|
kfree(thread->dsts[i]);
|
||||||
err_dstbuf:
|
|
||||||
kfree(thread->dsts);
|
kfree(thread->dsts);
|
||||||
err_dsts:
|
err_dsts:
|
||||||
|
err_srcbuf:
|
||||||
for (i = 0; thread->srcs[i]; i++)
|
for (i = 0; thread->srcs[i]; i++)
|
||||||
kfree(thread->srcs[i]);
|
kfree(thread->srcs[i]);
|
||||||
err_srcbuf:
|
|
||||||
kfree(thread->srcs);
|
kfree(thread->srcs);
|
||||||
err_srcs:
|
err_srcs:
|
||||||
kfree(pq_coefs);
|
kfree(pq_coefs);
|
||||||
|
|
Loading…
Reference in a new issue