All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: imre.deak@intel.com
Cc: intel-gfx@lists.freedesktop.org
Subject: [Intel-gfx] [bug report] drm/i915/tc: Fix TypeC PHY connect/disconnect logic on ADL-P
Date: Fri, 1 Oct 2021 16:25:35 +0300	[thread overview]
Message-ID: <20211001132535.GA7930@kili> (raw)

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.

  4029			kfree(dig_port->hdcp_port_data.streams);
  4030		kfree(dig_port);

regards,
dan carpenter

             reply	other threads:[~2021-10-01 13:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-01 13:25 Dan Carpenter [this message]
2021-10-01 14:20 ` [Intel-gfx] [bug report] drm/i915/tc: Fix TypeC PHY connect/disconnect logic on ADL-P Ville Syrjälä
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=20211001132535.GA7930@kili \
    --to=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.