GEM: allocated buffer size must be PAGE_SIZE alignment

PD#158474: do PAGE_SIZE alignment before initializing gem object

Change-Id: I98723ed2a22cfdc279253e06725482a656535184
Signed-off-by: binqi.zhang <binqi.zhang@amlogic.com>
This commit is contained in:
binqi.zhang
2018-05-17 18:54:44 +08:00
committed by Yixun Lan
parent b208d6cc7f
commit 4b623299e4

View File

@@ -99,6 +99,9 @@ struct am_meson_gem_object *am_meson_gem_object_create(
return ERR_PTR(-EINVAL);
}
size = roundup(size, PAGE_SIZE);
if (size == 0)
return ERR_PTR(-EINVAL);
meson_gem_obj = kzalloc(sizeof(*meson_gem_obj), GFP_KERNEL);
if (!meson_gem_obj)
return ERR_PTR(-ENOMEM);