All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
To: vitaly.prosyak-5C7GfCeVMHo@public.gmane.org
Cc: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: [bug report] drm/amd/display: Handle HDR use cases.
Date: Wed, 14 Mar 2018 11:53:57 +0300	[thread overview]
Message-ID: <20180314085357.GA12608@mwanda> (raw)

Hello Vitaly Prosyak,

The patch 44c6f2e59ee8: "drm/amd/display: Handle HDR use cases." from
Feb 13, 2018, leads to the following static checker warning:

	drivers/gpu/drm/amd/amdgpu/../display/dc/dcn10/dcn10_cm_common.c:543 cm_helper_translate_curve_to_degamma_hw_format()
	warn: potential off by one (named limit 'MAX_REGIONS_NUMBER') 'seg_distr[k]'

drivers/gpu/drm/amd/amdgpu/../display/dc/dcn10/dcn10_cm_common.c
   530          lut_params->hw_points_num = hw_points;
   531  
   532          i = 1;
   533          for (k = 0; k < MAX_REGIONS_NUMBER && i < MAX_REGIONS_NUMBER; k++) {
                            ^^^^^^^^^^^^^^^^^^^^^^
Imagine we hit this limit and k == MAX_REGIONS_NUMBER,

   534                  if (seg_distr[k] != -1) {
   535                          lut_params->arr_curve_points[k].segments_num =
   536                                          seg_distr[k];
   537                          lut_params->arr_curve_points[i].offset =
   538                                          lut_params->arr_curve_points[k].offset + (1 << seg_distr[k]);
   539                  }
   540                  i++;
   541          }
   542  
   543          if (seg_distr[k] != -1)
                    ^^^^^^^^^^^^^^^^^^
then this would be a problem.

   544                  lut_params->arr_curve_points[k].segments_num = seg_distr[k];
   545  

regards,
dan carpenter
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

                 reply	other threads:[~2018-03-14  8:53 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20180314085357.GA12608@mwanda \
    --to=dan.carpenter-qhclzuegtsvqt0dzr+alfa@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=vitaly.prosyak-5C7GfCeVMHo@public.gmane.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.