intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [Intel-gfx] [bug report] drm/i915: Replace some gamma_mode ifs with switches
@ 2020-11-02 13:07 Dan Carpenter
  2020-11-02 13:08 ` Dan Carpenter
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2020-11-02 13:07 UTC (permalink / raw)
  To: ville.syrjala; +Cc: intel-gfx

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-11-02 13:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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).