misc: fastrpc: Unmap only if buffer is unmapped from DSP
authorEkansh Gupta <quic_ekangupt@quicinc.com>
Fri, 13 Oct 2023 12:20:07 +0000 (13:20 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 16 Oct 2023 18:58:50 +0000 (20:58 +0200)
commit509143385db364c67556a914bef6c9a42fd2c74c
tree14ec1b198dc9029a1574e582bbab718466db951c
parent1c8093591d1e372d700fe65423e7315a8ecf721b
misc: fastrpc: Unmap only if buffer is unmapped from DSP

For unmapping any buffer from kernel, it should first be unmapped
from DSP. In case unmap from DSP request fails, the map should not
be removed from kernel as it might lead to SMMU faults and other
memory issues.

Fixes: 5c1b97c7d7b7 ("misc: fastrpc: add support for FASTRPC_IOCTL_MEM_MAP/UNMAP")
Cc: stable <stable@kernel.org>
Signed-off-by: Ekansh Gupta <quic_ekangupt@quicinc.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20231013122007.174464-5-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/fastrpc.c