mei: allow map and unmap of client dma buffer only for disconnected client
authorTomas Winkler <tomas.winkler@intel.com>
Thu, 18 Mar 2021 05:59:59 +0000 (07:59 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 23 Mar 2021 14:15:15 +0000 (15:15 +0100)
commitce068bc7da473e39b64d130101e178406023df0c
tree4d37a3caccb9ba2545535f0431e6638d2d685a70
parent903079a54cac47ab115fa5abbde6860cf94e258f
mei: allow map and unmap of client dma buffer only for disconnected client

Allow map and unmap of the client dma buffer only when the client is not
connected. The functions return -EPROTO if the client is already connected.
This is to fix the race when traffic may start or stop when buffer
is not available.

Cc: <stable@vger.kernel.org> #v5.11+
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Link: https://lore.kernel.org/r/20210318055959.305627-1-tomas.winkler@intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/mei/client.c