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()? > + 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