video: rockchip: mpp: fix the decoding buf is released issue

Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I66906651dc3e80470d0873cae7fce8ee1e662b0a
This commit is contained in:
Yandong Lin
2022-09-27 11:47:47 +08:00
committed by Tao Huang
parent 7d56606706
commit 494310d199

View File

@@ -97,7 +97,7 @@ mpp_dma_remove_extra_buffer(struct mpp_dma_session *dma)
oldest = buffer;
}
}
if (oldest)
if (oldest && kref_read(&oldest->ref) <= 1)
kref_put(&oldest->ref, mpp_dma_release_buffer);
mutex_unlock(&dma->list_mutex);
}