rpmsg: char: Add mutex protection for rpmsg_eptdev_open()
authorShengjiu Wang <shengjiu.wang@nxp.com>
Sat, 21 May 2022 03:35:05 +0000 (11:35 +0800)
committerMathieu Poirier <mathieu.poirier@linaro.org>
Tue, 14 Jun 2022 20:58:10 +0000 (14:58 -0600)
commitabe13e9a561d6b3e82b21362c0d6dd3ecd8a5b13
tree8f964772405ec041206ea18b0f55434b03b19625
parentb13baccc3850ca8b8cccbf8ed9912dbaa0fdf7f3
rpmsg: char: Add mutex protection for rpmsg_eptdev_open()

There is no mutex protection for rpmsg_eptdev_open(),
especially for eptdev->ept read and write operation.
It may cause issues when multiple instances call
rpmsg_eptdev_open() in parallel,the return state
may be success or EBUSY.

Fixes: 964e8bedd5a1 ("rpmsg: char: Return an error if device already open")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1653104105-16779-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
drivers/rpmsg/rpmsg_char.c