diff options
author | Sven Peter <sven@svenpeter.dev> | 2022-11-14 19:59:24 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-11-22 19:27:27 +0300 |
commit | b6ddd180e3d9f92c1e482b3cdeec7dda086b1341 (patch) | |
tree | 791683ecf17168f1fb8b817267c23576ae46fe98 /drivers/usb/typec/bus.c | |
parent | 7b462b05e47adaf11358f5c2c24db85c487b613e (diff) | |
download | linux-b6ddd180e3d9f92c1e482b3cdeec7dda086b1341.tar.xz |
usb: typec: Check for ops->exit instead of ops->enter in altmode_exit
typec_altmode_exit checks if ops->enter is not NULL but then calls
ops->exit a few lines below. Fix that and check for the function
pointer it's about to call instead.
Fixes: 8a37d87d72f0 ("usb: typec: Bus type for alternate modes")
Signed-off-by: Sven Peter <sven@svenpeter.dev>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20221114165924.33487-1-sven@svenpeter.dev
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/typec/bus.c')
-rw-r--r-- | drivers/usb/typec/bus.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/typec/bus.c b/drivers/usb/typec/bus.c index 26ea2fdec17d..31c2a3130cad 100644 --- a/drivers/usb/typec/bus.c +++ b/drivers/usb/typec/bus.c @@ -134,7 +134,7 @@ int typec_altmode_exit(struct typec_altmode *adev) if (!adev || !adev->active) return 0; - if (!pdev->ops || !pdev->ops->enter) + if (!pdev->ops || !pdev->ops->exit) return -EOPNOTSUPP; /* Moving to USB Safe State */ |