All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: dri-devel@lists.sourceforge.net
Cc: David Airlie <airlied@linux.ie>
Subject: drm_edid: potential range checking issue?
Date: Sun, 28 Mar 2010 14:25:58 +0300	[thread overview]
Message-ID: <20100328112558.GM5069@bicker> (raw)

Hi list,  :)

Just going through some Smatch warnings.

drivers/gpu/drm/drm_edid.c +1032 add_detailed_modes() 'data->data.timings' 5 <= 5
  1027                  /* Six modes per detailed section */
  1028                  for (i = 0; i < 6; i++) {
  1029                          struct std_timing *std;
  1030                          struct drm_display_mode *newmode;
  1031
  1032                          std = &data->data.timings[i];
                                      ^^^^^^^^^^^^^^^^^^^^^^

In include/drm/drm_edid.h this array has 5 elements not 6.

struct detailed_non_pixel {
        u8 pad1;
        u8 type; /* ff=serial, fe=string, fd=monitor range, fc=monitor name
                    fb=color point data, fa=standard timing data,
                    f9=undefined, f8=mfg. reserved */
        u8 pad2;
        union {         
                struct detailed_data_string str;
                struct detailed_data_monitor_range range;
                struct detailed_data_wpindex color;
                struct std_timing timings[5];
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                struct cvt_timing cvt[4];
        } data; 
} __attribute__((packed));

regards,
dan carpenter

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--

             reply	other threads:[~2010-03-28 11:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-28 11:25 Dan Carpenter [this message]
2010-05-07  8:35 ` drm_edid: potential range checking issue? Dan Carpenter
2010-05-10 16:08   ` Adam Jackson
2010-05-14 11:06     ` [patch] drm_edid: There should be 6 Standard Timings Dan Carpenter
2010-05-18 14:30       ` Adam Jackson

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=20100328112558.GM5069@bicker \
    --to=error27@gmail.com \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.sourceforge.net \
    /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.