From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= Subject: Re: [PATCH] drm: Try loading builtin EDIDs first Date: Wed, 2 Oct 2013 12:56:22 +0300 Message-ID: <20131002095622.GV9395@intel.com> References: <8761tg3y9p.fsf@intel.com> <1380704859-10157-1-git-send-email-chris@chris-wilson.co.uk> <20131002092207.GU9395@intel.com> <20131002093235.GB21062@nuc-i3427.alporthouse.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTP id DC03AE73AC for ; Wed, 2 Oct 2013 02:56:26 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20131002093235.GB21062@nuc-i3427.alporthouse.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: Chris Wilson , dri-devel@lists.freedesktop.org, Jani Nikula List-Id: dri-devel@lists.freedesktop.org On Wed, Oct 02, 2013 at 10:32:35AM +0100, Chris Wilson wrote: > On Wed, Oct 02, 2013 at 12:22:07PM +0300, Ville Syrj=E4l=E4 wrote: > > > +static bool edid_check_size(const u8 *data, int data_size) > > > +{ > > > + if (data[0x7e] > 0x7e) > > > + return false; > > = > > That should be 'if (data_size <=3D 0x7e) return false;' no? > > = > > Or maybe just 'data_size < EDID_LENGTH' since we anyway want a > > multiple of EDID_LENGTH. > = > Hmm, I'm missing the point here then. If edid_size() only returns a > non-zero mulitple of EDID_LENGTH, data_size must also be a non-zero > multiple of EDID_LENGTH for it to pass. The point is to check that the edid[0x7e] access in fact lands inside our data and not somewhere else. > = > If you want to simply give me your ideal check_size()... :) > -Chris > = > -- = > Chris Wilson, Intel Open Source Technology Centre -- = Ville Syrj=E4l=E4 Intel OTC