usb: chipidea: core: fix possible concurrent when switch role
stable inclusion from stable-v5.10.177 commit 09671cfc2b22fa1a4cec29464205d9ac62f821e5 category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I88YNP Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=09671cfc2b22fa1a4cec29464205d9ac62f821e5 -------------------------------- commit 451b15ed upstream. The user may call role_store() when driver is handling ci_handle_id_switch() which is triggerred by otg event or power lost event. Unfortunately, the controller may go into chaos in this case. Fix this by protecting it with mutex lock. Fixes: a932a804 ("usb: chipidea: core: add sysfs group") cc: <stable@vger.kernel.org> Acked-by:Peter Chen <peter.chen@kernel.org> Signed-off-by:
Xu Yang <xu.yang_2@nxp.com> Link: https://lore.kernel.org/r/20230317061516.2451728-2-xu.yang_2@nxp.com Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by:
sanglipeng <sanglipeng1@jd.com>
Loading
Please sign in to comment