msm: ADSPRPC: Fix error paths to avoid double-frees and other badness

The error paths in fastrpc_device_init() and fastrpc_init() did
not properly roll back their operations. It was also possible for
fastrpc_deinit() to be called multiple times in the course of
handling a single initialization error in fastrpc_init(), such as
an SMD channel failing to open. This would result in a double-free
of the context list, leading to potential memory corruption.

CRs-Fixed: 478489
Change-Id: Ie078ce6595dc67316c25b9be9daf540552dccc2d
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
1 file changed