From: Greg KH <gregkh@linuxfoundation.org>
To: Jeffin Philip <jeffinphilip14@gmail.com>
Cc: heikki.krogerus@linux.intel.com, mika.westerberg@linux.intel.com,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
syzbot+520d7648a0d934061fb0@syzkaller.appspotmail.com,
syzbot+1a01783ea233350598b5@syzkaller.appspotmail.com,
stable@vger.kernel.org
Subject: Re: [PATCH] usb: typec: fix null-pointer-dereference in wcove_typec_probe()
Date: Fri, 21 Aug 2026 17:00:12 +0200 [thread overview]
Message-ID: <2026082125-getting-upstroke-a146@gregkh> (raw)
In-Reply-To: <20260821135246.17907-1-jeffinphilip14@gmail.com>
On Fri, Aug 21, 2026 at 07:22:46PM +0530, Jeffin Philip wrote:
> dev_get_drvdata() on the parent device can return NULL if we attempt to
> bind our device as a root device with no parent. This causes a null pointer
> dereference when accessing pmic->regmap later as pmic uses the parent
> struct. Fix this by adding a NULL check for pmic and returning -ENODEV
> if to_platform_device() returns NULL for pmic.
>
> Reported-by: syzbot+1a01783ea233350598b5@syzkaller.appspotmail.com
> Closes: https://syzkaller.appspot.com/bug?extid=1a01783ea233350598b5
> Fixes: d2061f9cc32d ("usb: typec: add driver for Intel Whiskey Cove PMIC USB Type-C PHY")
> Cc: stable@vger.kernel.org
> Signed-off-by: Jeffin Philip <jeffinphilip14@gmail.com>
> ---
> drivers/usb/typec/tcpm/wcove.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/usb/typec/tcpm/wcove.c b/drivers/usb/typec/tcpm/wcove.c
> index 0e5a3e277c3e..80bca8edeba6 100644
> --- a/drivers/usb/typec/tcpm/wcove.c
> +++ b/drivers/usb/typec/tcpm/wcove.c
> @@ -612,6 +612,10 @@ static int wcove_typec_probe(struct platform_device *pdev)
> int irq;
> int ret;
>
> + /* check if we have a parent device first */
> + if (!pmic)
> + return -ENODEV;
How can a platform device NOT have a parent device? WHat system is this
broken in? Why not fix the platform definition properly instead as
something is really wrong here if this is a "root" platform device as
that should never happen.
thanks,
greg k-h
next prev parent reply other threads:[~2026-08-21 15:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-21 13:52 [PATCH] usb: typec: fix null-pointer-dereference in wcove_typec_probe() Jeffin Philip
2026-08-21 15:00 ` Greg KH [this message]
2026-08-21 15:11 ` Jeffin Philip
2026-08-21 15:19 ` Greg KH
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=2026082125-getting-upstroke-a146@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=heikki.krogerus@linux.intel.com \
--cc=jeffinphilip14@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mika.westerberg@linux.intel.com \
--cc=stable@vger.kernel.org \
--cc=syzbot+1a01783ea233350598b5@syzkaller.appspotmail.com \
--cc=syzbot+520d7648a0d934061fb0@syzkaller.appspotmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.