In function vbox_dumb_create() of vbox_main.c, It calls vbox_gem_create() for creating drm_gem_object. and it calls vbox_gem_handle_create() for handle. If handle creation fails only, drm_gem_object should be released by calling drm_gem_object_put_unlocked(). Signed-off-by: Sidong Yang <realwakka@xxxxxxxxx> --- drivers/staging/vboxvideo/vbox_main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/staging/vboxvideo/vbox_main.c b/drivers/staging/vboxvideo/vbox_main.c index e1fb70a42d32..ca676ba37bb4 100644 --- a/drivers/staging/vboxvideo/vbox_main.c +++ b/drivers/staging/vboxvideo/vbox_main.c @@ -312,9 +312,10 @@ int vbox_dumb_create(struct drm_file *file, return ret; ret = drm_gem_handle_create(file, gobj, &handle); - drm_gem_object_put_unlocked(gobj); - if (ret) + if (ret) { + drm_gem_object_put_unlocked(gobj); return ret; + } args->handle = handle; -- 2.11.0 _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel