aboutsummaryrefslogtreecommitdiff
path: root/drivers/misc/aspeed-lpc-ctrl.c
diff options
context:
space:
mode:
authorLogan Gunthorpe <[email protected]>2017-03-17 12:48:22 -0600
committerGreg Kroah-Hartman <[email protected]>2017-03-21 06:44:33 +0100
commitac1ddc584e9817d9d0a4572f3245305d907c6e61 (patch)
tree73b664e8d4a109d05db0fd947c3f9ac5811d209f /drivers/misc/aspeed-lpc-ctrl.c
parentd5ed9177f64fe95d9de79e6504d41612d9127e8a (diff)
scsi: utilize new cdev_device_add helper function
This driver did not set kobj.parent so it likely suffered from a potential use after free race if the user unregistered the device while it was in use. This was not so straightforward a conversion but I think this patch cleans up its probe's error path significantly. This patch adds device_initialize, which is required for cdev_device_add. Then it switches to put_device instead of kfree as recommended by device_initialize's documentation. This removes a lot from the error path which was already in __remove. A couple things needed to be re-ordered to be entirely correct, though. ida_remove is also moved out of __remove and into unregister to simplify things and follow the pattern other devices are using. This also drop an extra unnecessary get_device/put_device in the code. Signed-off-by: Logan Gunthorpe <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'drivers/misc/aspeed-lpc-ctrl.c')
0 files changed, 0 insertions, 0 deletions