usb: typec: ucsi: displayport: Fix a potential race during registration
authorHeikki Krogerus <heikki.krogerus@linux.intel.com>
Wed, 11 Mar 2020 13:00:06 +0000 (16:00 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 25 Mar 2020 07:25:51 +0000 (08:25 +0100)
commit186b9564cf5ef5e49cf1350b6c78a8c708c76f76
treeb62ef367059c445d5083aa3107ecd09fa7057d20
parentff1d876e9f4f98c3a23a8fcfe13d87a18a69b881
usb: typec: ucsi: displayport: Fix a potential race during registration

commit 081da1325d351ea8804cf74e65263ea120834f33 upstream.

Locking the connector in ucsi_register_displayport() to make
sure that nothing can access the displayport alternate mode
before the function has finished and the alternate mode is
actually ready.

Fixes: af8622f6a585 ("usb: typec: ucsi: Support for DisplayPort alt mode")
Cc: stable@vger.kernel.org
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20200311130006.41288-3-heikki.krogerus@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/ucsi/displayport.c