Commit e7a2a2e3 authored by liu chuansheng's avatar liu chuansheng Committed by Ben Hutchings

drm/radeon: Calling object_unrefer() when creating fb failure

commit f2d68cf4 upstream.

When kzalloc() failed in radeon_user_framebuffer_create(), need to
call object_unreference() to match the object_reference().
Signed-off-by: default avatarliu chuansheng <chuansheng.liu@intel.com>
Signed-off-by: default avatarxueminsu <xuemin.su@intel.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
parent 93322d7f
...@@ -1110,8 +1110,10 @@ radeon_user_framebuffer_create(struct drm_device *dev, ...@@ -1110,8 +1110,10 @@ radeon_user_framebuffer_create(struct drm_device *dev,
} }
radeon_fb = kzalloc(sizeof(*radeon_fb), GFP_KERNEL); radeon_fb = kzalloc(sizeof(*radeon_fb), GFP_KERNEL);
if (radeon_fb == NULL) if (radeon_fb == NULL) {
drm_gem_object_unreference_unlocked(obj);
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
}
radeon_framebuffer_init(dev, radeon_fb, mode_cmd, obj); radeon_framebuffer_init(dev, radeon_fb, mode_cmd, obj);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment