Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: ville.syrjala@linux.intel.com
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [bug report] drm/i915: Replace some gamma_mode ifs with switches
Date: Mon, 2 Nov 2020 16:08:45 +0300	[thread overview]
Message-ID: <20201102130845.GW18329@kadam> (raw)
In-Reply-To: <20201102130736.GA31073@mwanda>

Similar bug:

drivers/gpu/drm/i915/display/intel_color.c:794 bdw_load_luts() error: we previously assumed 'gamma_lut' could be null (see line 784)

regards,
dan carpenter

On Mon, Nov 02, 2020 at 04:07:36PM +0300, Dan Carpenter wrote:
> Hello Ville Syrjälä,
> 
> This is a semi-automatic email about new static checker warnings.
> 
> The patch 7852ddd5d60a: "drm/i915: Replace some gamma_mode ifs with 
> switches" from Sep 25, 2020, leads to the following Smatch complaint:
> 
>     drivers/gpu/drm/i915/display/intel_color.c:765 ivb_load_luts()
>     error: we previously assumed 'gamma_lut' could be null (see line 755)
> 
> drivers/gpu/drm/i915/display/intel_color.c
>    754		const struct drm_property_blob *degamma_lut = crtc_state->hw.degamma_lut;
>    755		const struct drm_property_blob *blob = gamma_lut ?: degamma_lut;
>                                                        ^^^^^^^^^^^^
> Check for NULL
> 
>    756	
>    757		switch (crtc_state->gamma_mode) {
>    758		case GAMMA_MODE_MODE_8BIT:
>    759			ilk_load_lut_8(crtc, blob);
>    760			break;
>    761		case GAMMA_MODE_MODE_SPLIT:
>    762			ivb_load_lut_10(crtc, degamma_lut, PAL_PREC_SPLIT_MODE |
>    763					PAL_PREC_INDEX_VALUE(0));
>    764			ivb_load_lut_ext_max(crtc_state);
>    765			ivb_load_lut_10(crtc, gamma_lut, PAL_PREC_SPLIT_MODE |
>                                               ^^^^^^^^^
> Unchecked dereference.  Possibly pass "blob" here?
> 
>    766					PAL_PREC_INDEX_VALUE(512));
>    767			break;
> 
> regards,
> dan carpenter
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

      reply	other threads:[~2020-11-02 13:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-02 13:07 [Intel-gfx] [bug report] drm/i915: Replace some gamma_mode ifs with switches Dan Carpenter
2020-11-02 13:08 ` Dan Carpenter [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=20201102130845.GW18329@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=ville.syrjala@linux.intel.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