From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Sven Peter <sven@svenpeter.dev>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] usb: typec: Check for ops->exit instead of ops->enter in altmode_exit
Date: Wed, 16 Nov 2022 14:05:43 +0200 [thread overview]
Message-ID: <Y3TSF+2XkejIk8UG@kuha.fi.intel.com> (raw)
In-Reply-To: <20221114165924.33487-1-sven@svenpeter.dev>
On Mon, Nov 14, 2022 at 05:59:24PM +0100, Sven Peter wrote:
> 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>
No Cc: stable@...?
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> ---
> drivers/usb/typec/bus.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> 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 */
thanks,
--
heikki
prev parent reply other threads:[~2022-11-16 12:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-14 16:59 [PATCH] usb: typec: Check for ops->exit instead of ops->enter in altmode_exit Sven Peter
2022-11-16 12:05 ` Heikki Krogerus [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y3TSF+2XkejIk8UG@kuha.fi.intel.com \
--to=heikki.krogerus@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=sven@svenpeter.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox