Skip to content

Commit

Permalink
drm/radeon: Calling object_unrefer() when creating fb failure
Browse files Browse the repository at this point in the history
When kzalloc() failed in radeon_user_framebuffer_create(), need to
call object_unreference() to match the object_reference().

Signed-off-by: liu chuansheng <chuansheng.liu@intel.com>
Signed-off-by: xueminsu <xuemin.su@intel.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
  • Loading branch information
liu chuansheng authored and Alex Deucher committed Jan 31, 2013
1 parent 39dc9aa commit f2d68cf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/gpu/drm/radeon/radeon_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -1115,8 +1115,10 @@ radeon_user_framebuffer_create(struct drm_device *dev,
}

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);
}

ret = radeon_framebuffer_init(dev, radeon_fb, mode_cmd, obj);
if (ret) {
Expand Down

0 comments on commit f2d68cf

Please sign in to comment.