mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 20:07:46 +09:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user