mediatek: Open restricted_mtk_cma in O_RDONLY

The write permission for restricted_mtk_cma is unnecessary.

Bug: 433330646
Test: allocate a buffer with GRALLOC_USAGE_PROTECTED usage
Flag: EXEMPT: desktop-only change
Change-Id: Id99a0e03f2e1c7cbb9f15596316dd21aaebdf4a3
This commit is contained in:
Hirokazu Honda 2025-07-22 13:40:15 -07:00
parent c785301bd3
commit a3dd421100

View file

@ -143,7 +143,7 @@ static int mediatek_init(struct driver *drv)
}
#if defined(HAS_DMABUF_SYSTEM_HEAP)
priv->dma_heap_fd = open("/dev/dma_heap/restricted_mtk_cma", O_RDWR | O_CLOEXEC);
priv->dma_heap_fd = open("/dev/dma_heap/restricted_mtk_cma", O_RDONLY | O_CLOEXEC);
if (priv->dma_heap_fd < 0) {
drv_loge("Failed opening secure CMA heap errno=%d\n", -errno);
protected = 0;