diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2019-06-28 16:07:37 +0800 |
---|---|---|
committer | Joel Stanley <joel@jms.id.au> | 2019-07-03 10:42:53 +0930 |
commit | 371975b0b07520c85098652d561639837a60a905 (patch) | |
tree | aac84f2d733510e69e1d8031ea4a8cf7a818b51a /drivers/misc | |
parent | afd26118f0dcf29db031a213f6f95c46ff3bdcbe (diff) |
fsi/core: Fix error paths on CFAM init
Change d1dcd67825 re-worked the struct fsi_slave initialisation in
fsi_slave_init, but introduced a few inconsitencies: the slave->dev is
now registered through cdev_device_add, but we may kfree() the device
out from underneath the cdev registration. We may also leave an IDA
allocated.
This change fixes the error paths, so that we kfree() only before the
device is registered with the core code. We also move the smode write to
before we start creating proper devices, as it's the most likely to
fail. We also remove the IDA-allocated minor on error, and properly
clean up the of_node.
Fixes: d1dcd6782576 ("fsi: Add cfam char devices")
Reported-by: Lei YU <mine260309@gmail.com>
Tested-by: John Wang <wangzqbj@inspur.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Joel Stanley <joel@jms.id.au>
Diffstat (limited to 'drivers/misc')
0 files changed, 0 insertions, 0 deletions