Re: [PATCH 40/44] staging: unisys: Convert device creation to use visor_device

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

 



On Sat, May 16, 2015 at 02:32:33PM +0300, Dan Carpenter wrote:
> On Wed, May 13, 2015 at 01:22:34PM -0400, Benjamin Romer wrote:
> > @@ -1022,29 +997,21 @@ create_visor_device(struct visor_device *bdev,
> >  		goto away;
> >  	}
> >  
> > -	/* note: device_register is simply device_initialize + device_add */
> > -	registered1 = true;
> > -
> >  	rc = register_devmajorminor_attributes(dev);
> >  	if (rc < 0) {
> >  		POSTCODE_LINUX_3(DEVICE_REGISTER_FAILURE_PC, chipset_dev_no,
> >  				 DIAG_SEVERITY_ERR);
> > -		goto away;
> > +		goto away_register;
> >  	}
> >  
> > -	registered2 = true;
> > -	rc = 0;
> > +	list_add_tail(&dev->list_all, &list_all_device_instances);
> > +	put_device(&dev->device);
> 
> We don't want to call put_device() on the success path.  It hopefully
> would have triggered an error if we call remove_visor_device()?

Yup, I agree.  Mistake on my part when I was tweaking the failure paths
here.  Thanks!  Let me respin that patch.

Cheers,
Don

> 
> > +	return 0;
> >  
> > +away_register:
> > +	device_unregister(&dev->device);
> >  away:
> 
> 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