diff options
author | Thomas Zimmermann <tzimmermann@suse.de> | 2021-11-30 10:52:55 +0100 |
---|---|---|
committer | Thomas Zimmermann <tzimmermann@suse.de> | 2021-12-02 11:12:39 +0100 |
commit | 4ff22f487f8c26b99cbe1678344595734c001a39 (patch) | |
tree | 02fd49b249e5a1e9d4242caa88668d91fdf65d72 /drivers/gpu/drm/vgem | |
parent | 2696f9010d21aee60be06b2135806e11c79ded8b (diff) | |
download | linux-4ff22f487f8c26b99cbe1678344595734c001a39.tar.gz linux-4ff22f487f8c26b99cbe1678344595734c001a39.tar.bz2 linux-4ff22f487f8c26b99cbe1678344595734c001a39.zip |
drm: Return error codes from struct drm_driver.gem_create_object
GEM helper libraries use struct drm_driver.gem_create_object to let
drivers override GEM object allocation. On failure, the call returns
NULL.
Change the semantics to make the calls return a pointer-encoded error.
This aligns the callback with its callers. Fixes the ingenic driver,
which already returns an error pointer.
Also update the callers to handle the involved types more strictly.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Steven Price <steven.price@arm.com>
Acked-by: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20211130095255.26710-1-tzimmermann@suse.de
Diffstat (limited to 'drivers/gpu/drm/vgem')
-rw-r--r-- | drivers/gpu/drm/vgem/vgem_drv.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/vgem/vgem_drv.c b/drivers/gpu/drm/vgem/vgem_drv.c index a87eafa89e9f..c5e3e5457737 100644 --- a/drivers/gpu/drm/vgem/vgem_drv.c +++ b/drivers/gpu/drm/vgem/vgem_drv.c @@ -97,7 +97,7 @@ static struct drm_gem_object *vgem_gem_create_object(struct drm_device *dev, siz obj = kzalloc(sizeof(*obj), GFP_KERNEL); if (!obj) - return NULL; + return ERR_PTR(-ENOMEM); /* * vgem doesn't have any begin/end cpu access ioctls, therefore must use |