linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: "Shah, Nehal-bakulchandra" <nehal-bakulchandra.shah@amd.com>
Cc: "Shah, Nehal-bakulchandra" <nbshah@amd.com>,
	ajayg@nvidia.com, linux-usb@vger.kernel.org
Subject: Re: UCSI:CCG: AMD Platform
Date: Thu, 27 Feb 2020 14:23:08 +0200	[thread overview]
Message-ID: <20200227122308.GC10532@kuha.fi.intel.com> (raw)
In-Reply-To: <e0ab390b-743a-d583-15c4-83af3a7dca35@amd.com>

[-- Attachment #1: Type: text/plain, Size: 864 bytes --]

On Mon, Feb 24, 2020 at 02:38:12PM +0530, Shah, Nehal-bakulchandra wrote:
> Hi
> 
> On 2/14/2020 7:58 PM, Shah, Nehal-bakulchandra wrote:
> > Hi
> >
> > On 2/13/2020 5:35 PM, Heikki Krogerus wrote:
> >> On Thu, Feb 13, 2020 at 02:00:14PM +0200, Heikki Krogerus wrote:
> >>>> I am using CCG based UCSI driver without any
> >>>> modification.For I2C part i have written custom
> >>>> driver.
> >>>>
> >>>> I have attached the trace out and dmesg crash log.
> >>>>
> >>>> Please have a look
> >>> Thanks for the logs. Can you test the attached diff?
> >> Actually, don't try that one. Try this one instead.
> > Sure i will update on this on Monday.
> >
> >
> > thanks
> >
> > Nehal
> 
> Patch is not solving the issue. I have attached both trace and dmesg output.

How about if you try this (the attached patch) together with that
previous diff?

thanks,

-- 
heikki

[-- Attachment #2: 0001-usb-typec-ucsi-displayport-Fix-potential-NULL-pointe.patch --]
[-- Type: text/plain, Size: 1084 bytes --]

From fa1aff5e8e7464851470f29eeae45bde1f089ce1 Mon Sep 17 00:00:00 2001
From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Date: Mon, 17 Feb 2020 18:07:17 +0300
Subject: [PATCH] usb: typec: ucsi: displayport: Fix potential NULL pointer
 dereference

In ucsi_displayport_remove_partner(), if the DisplayPort alt
mode was never registered, then there is also no driver data
for it. Adding a check to make sure there really is driver
data for the device before modifying it.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
---
 drivers/usb/typec/ucsi/displayport.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/usb/typec/ucsi/displayport.c b/drivers/usb/typec/ucsi/displayport.c
index 0f1273ae086c..261131c9e37c 100644
--- a/drivers/usb/typec/ucsi/displayport.c
+++ b/drivers/usb/typec/ucsi/displayport.c
@@ -271,6 +271,9 @@ void ucsi_displayport_remove_partner(struct typec_altmode *alt)
 		return;
 
 	dp = typec_altmode_get_drvdata(alt);
+	if (!dp)
+		return;
+
 	dp->data.conf = 0;
 	dp->data.status = 0;
 	dp->initialized = false;
-- 
2.25.0


  reply	other threads:[~2020-02-27 12:23 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-03  5:22 UCSI:CCG: AMD Platform Shah, Nehal-bakulchandra
2020-02-03 13:28 ` Heikki Krogerus
2020-02-03 13:32   ` Heikki Krogerus
2020-02-10 10:09     ` Shah, Nehal-bakulchandra
2020-02-13 12:00       ` Heikki Krogerus
2020-02-13 12:05         ` Heikki Krogerus
2020-02-14 14:28           ` Shah, Nehal-bakulchandra
2020-02-24  9:08             ` Shah, Nehal-bakulchandra
2020-02-27 12:23               ` Heikki Krogerus [this message]
2020-02-27 16:59                 ` Shah, Nehal-bakulchandra
2020-02-29  3:25                   ` Shah, Nehal-bakulchandra
2020-03-26  8:35                     ` Heikki Krogerus
2020-03-26 13:41                       ` Shah, Nehal-bakulchandra

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=20200227122308.GC10532@kuha.fi.intel.com \
    --to=heikki.krogerus@linux.intel.com \
    --cc=ajayg@nvidia.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=nbshah@amd.com \
    --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;
as well as URLs for NNTP newsgroup(s).