From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: imre.deak@intel.com, intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [bug report] drm/i915/tc: Fix TypeC PHY connect/disconnect logic on ADL-P
Date: Fri, 1 Oct 2021 17:20:17 +0300 [thread overview]
Message-ID: <YVcZIYZLZaPhXvm6@intel.com> (raw)
In-Reply-To: <20211001132535.GA7930@kili>
On Fri, Oct 01, 2021 at 04:25:35PM +0300, Dan Carpenter wrote:
> Hello Imre Deak,
>
> This is a semi-automatic email about new static checker warnings.
>
> The patch 3e0abc7661c8: "drm/i915/tc: Fix TypeC PHY
> connect/disconnect logic on ADL-P" from Sep 29, 2021, leads to the
> following Smatch complaint:
>
> drivers/gpu/drm/i915/display/intel_ddi.c:4028 intel_ddi_encoder_destroy()
> warn: variable dereferenced before check 'dig_port' (see line 4020)
>
> drivers/gpu/drm/i915/display/intel_ddi.c
> 4019 struct intel_digital_port *dig_port = enc_to_dig_port(to_intel_encoder(encoder));
> 4020 enum phy phy = intel_port_to_phy(i915, dig_port->base.port);
> ^^^^^^^^^^^^^^^^^^^
> The patch adds a new unchecked dereference.
>
> 4021
> 4022 intel_dp_encoder_flush_work(encoder);
> 4023 if (intel_phy_is_tc(i915, phy))
> 4024 intel_tc_port_flush_work(dig_port);
> 4025 intel_display_power_flush_work(i915);
> 4026
> 4027 drm_encoder_cleanup(encoder);
> 4028 if (dig_port)
> ^^^^^^^^
> But the existing code checked for NULL.
That check is nonsense. Feel free to nuke it.
>
> 4029 kfree(dig_port->hdcp_port_data.streams);
> 4030 kfree(dig_port);
>
> regards,
> dan carpenter
--
Ville Syrjälä
Intel
next prev parent reply other threads:[~2021-10-01 14:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-01 13:25 [Intel-gfx] [bug report] drm/i915/tc: Fix TypeC PHY connect/disconnect logic on ADL-P Dan Carpenter
2021-10-01 14:20 ` Ville Syrjälä [this message]
2021-10-01 14:52 ` Dan Carpenter
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=YVcZIYZLZaPhXvm6@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=dan.carpenter@oracle.com \
--cc=imre.deak@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
/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.