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
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to