[PATCH v3] staging: vboxvideo: Add vboxvideo to drivers/staging

Dan Carpenter dan.carpenter at oracle.com
Wed Jun 28 09:23:55 UTC 2017


On Mon, Jun 26, 2017 at 04:55:46PM +0200, Hans de Goede wrote:
> >> +int vbox_dumb_create(struct drm_file *file,
> >> +		     struct drm_device *dev, struct drm_mode_create_dumb *args)
> >> +{
> >> +	int ret;
> >> +	struct drm_gem_object *gobj;
> >> +	u32 handle;
> >> +
> >> +	args->pitch = args->width * ((args->bpp + 7) / 8);
> >> +	args->size = args->pitch * args->height;
> >> +
> >> +	ret = vbox_gem_create(dev, args->size, false, &gobj);
> >> +	if (ret)
> >> +		return ret;
> >> +
> >> +	ret = drm_gem_handle_create(file, gobj, &handle);
> >> +	drm_gem_object_unreference_unlocked(gobj);
> >> +	if (ret)
> >> +		return ret;
> >
> > This is a resource leak.
> 
> What makes you say that? Note the unreference done before the
> ret check. I could be missing something here, but I think this is fine ?
> 

You're right.  My bad.

regards,
dan carpenter




More information about the dri-devel mailing list