drm_gem_handle_create() should not have referenced an object when it's creation has failed for some reason. Signed-off-by: Egbert Eich <eich@xxxxxxxx> --- drivers/gpu/drm/mgag200/mgag200_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/mgag200/mgag200_main.c b/drivers/gpu/drm/mgag200/mgag200_main.c index 43ebf8d..d51096c 100644 --- a/drivers/gpu/drm/mgag200/mgag200_main.c +++ b/drivers/gpu/drm/mgag200/mgag200_main.c @@ -302,10 +302,11 @@ int mgag200_dumb_create(struct drm_file *file, return ret; ret = drm_gem_handle_create(file, gobj, &handle); - drm_gem_object_unreference_unlocked(gobj); if (ret) return ret; + drm_gem_object_unreference_unlocked(gobj); + args->handle = handle; return 0; } -- 1.8.1.4 _______________________________________________ dri-devel mailing list dri-devel@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/dri-devel