mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
dma-buf: buffer should align to cacheline size
Fixes: 0f4763b1c6 ("dma-buf: add DMA_BUF_IOCTL_SYNC_PARTIAL support")
Change-Id: Iff8b633cb89337bba3f7693a28657034a6aa2223
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
This commit is contained in:
@@ -39,6 +39,7 @@
|
||||
#include <linux/hashtable.h>
|
||||
#include <linux/list_sort.h>
|
||||
#include <linux/mount.h>
|
||||
#include <linux/cache.h>
|
||||
|
||||
#include <uapi/linux/dma-buf.h>
|
||||
#include <uapi/linux/magic.h>
|
||||
@@ -453,6 +454,9 @@ static long dma_buf_ioctl(struct file *file,
|
||||
if (sync_p.len == 0)
|
||||
return -EINVAL;
|
||||
|
||||
if ((sync_p.offset % cache_line_size()) || (sync_p.len % cache_line_size()))
|
||||
return -EINVAL;
|
||||
|
||||
if (sync_p.len > dmabuf->size || sync_p.offset > dmabuf->size - sync_p.len)
|
||||
return -EINVAL;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user