summaryrefslogtreecommitdiffstats
path: root/drivers/rapidio
diff options
context:
space:
mode:
authorLogan Gunthorpe <logang@deltatee.com>2017-03-17 12:48:19 -0600
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-03-21 06:44:33 +0100
commit493cfaeaa0c9bc0c79ce5751193d49fdac9aaaec (patch)
tree8ccf761b9668a2c00913a4400e85984006a98f9b /drivers/rapidio
parent857313e51006ff51524579bcd8808b70f9a80812 (diff)
downloadlinux-493cfaeaa0c9bc0c79ce5751193d49fdac9aaaec.tar.gz
linux-493cfaeaa0c9bc0c79ce5751193d49fdac9aaaec.tar.bz2
linux-493cfaeaa0c9bc0c79ce5751193d49fdac9aaaec.zip
mtd: utilize new cdev_device_add helper function
This is not as straightforward a conversion as the others in this series. These drivers did not originally make use of kobj.parent so they likely suffered from a use after free bug if someone unregistered the devices while they are being used. In order to make the conversions, switch from device_register to device_initialize / cdev_device_add. In build.c, this patch unwinds a complicated mess of extra get_device/put_devices and reference tracking by moving device_initialize early in the attach process. Then it always uses put_device and instead of using device_unregister and extra get_devices everywhere we just use cdev_device_del and one put_device once everything is completely done. This simplifies things dramatically and makes it easier to reason about. In vmt.c, the patch pushes device initialization up to the beginning of the device creation and then that function only needs to use put_device in the error path which simplifies things a good deal. Signed-off-by: Logan Gunthorpe <logang@deltatee.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/rapidio')
0 files changed, 0 insertions, 0 deletions