codec_mm: clear scatter cache when codec_mm_codec_in failed
authorYao.Liu <yao.liu@amlogic.com>
Thu, 22 Mar 2018 11:08:06 +0000 (19:08 +0800)
committerYixun Lan <yixun.lan@amlogic.com>
Fri, 23 Mar 2018 08:08:20 +0000 (00:08 -0800)
PD#158909: clear scatter cache when codec_mm_codec_in failed

Change-Id: Ie3f4da06699222b6dbd8caee6982dc71288881c1
Signed-off-by: Yao.Liu <yao.liu@amlogic.com>
drivers/amlogic/media/common/codec_mm/codec_mm.c

index c221e18..814e545 100644 (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. */