codec_mm: clear scatter cache when codec_mm_codec_in failed

PD#158909: clear scatter cache when codec_mm_codec_in failed

Change-Id: Ie3f4da06699222b6dbd8caee6982dc71288881c1
Signed-off-by: Yao.Liu <yao.liu@amlogic.com>
This commit is contained in:
Yao.Liu
2018-03-22 19:08:06 +08:00
committed by Yixun Lan
parent 3c7c04dc46
commit 7c34cfb346

View File

@@ -572,7 +572,7 @@ struct codec_mm_s *codec_mm_alloc(const char *owner, int size,
mem->align2n = align2n;
mem->flags = memflags;
ret = codec_mm_alloc_in(mgt, mem);
if (ret == -10003 &&
if (ret < 0 &&
mgt->alloced_for_sc_cnt > 0 && /*have used for scatter.*/
!(memflags & CODEC_MM_FLAGS_FOR_SCATTER)) {
/*if not scatter, free scatter caches. */