Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 371975b0 authored by Jeremy Kerr's avatar Jeremy Kerr Committed by Joel Stanley
Browse files

fsi/core: Fix error paths on CFAM init



Change d1dcd678 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: d1dcd678 ("fsi: Add cfam char devices")
Reported-by: default avatarLei YU <mine260309@gmail.com>
Tested-by: default avatarJohn Wang <wangzqbj@inspur.com>
Signed-off-by: default avatarJeremy Kerr <jk@ozlabs.org>
Signed-off-by: default avatarJoel Stanley <joel@jms.id.au>
parent afd26118
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment