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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux