public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: "Shah, Nehal-bakulchandra" <nehal-bakulchandra.shah@amd.com>
Cc: linux-usb@vger.kernel.org, basavaraj.natikar@amd.com
Subject: Re: Question on typec_unregister_altmode
Date: Thu, 15 Apr 2021 14:06:13 +0300	[thread overview]
Message-ID: <YHgeJd8mjw87OeBS@kuha.fi.intel.com> (raw)
In-Reply-To: <da32299e-e516-d592-29c2-941d0604b40a@amd.com>

Hi,

On Thu, Apr 15, 2021 at 04:19:06PM +0530, Shah, Nehal-bakulchandra wrote:
> Hi Heikki,
> 
> While working on one of the project i have observed one potential issue with typec_unregister_altmode.
> 
> If we unregister partners altmode then following code may fail and give the crash.

What crash?

> typec_mux_put(to_altmode(adev)->mux);
> 
> As partner does not get the mux during the register alt mode only port register alt mode has it.
> 
> so i think adev->mux should be checked for NULL/invalida pointer. Please correct my understanding.

If you check the implementation of typec_mux_put(), it already does
that. I don't understand the problem you are seeing?

If you are seeing a crash, then there should be a backtrace. Can you
please share that?

thanks,

-- 
heikki

      reply	other threads:[~2021-04-15 11:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-15 10:49 Question on typec_unregister_altmode Shah, Nehal-bakulchandra
2021-04-15 11:06 ` 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=YHgeJd8mjw87OeBS@kuha.fi.intel.com \
    --to=heikki.krogerus@linux.intel.com \
    --cc=basavaraj.natikar@amd.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=nehal-bakulchandra.shah@amd.com \
    /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