From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jani Nikula Subject: Re: [PATCH 2/5] drm/i915: fix intel_dp_aux_native_read's reply array size Date: Fri, 13 Sep 2013 16:41:42 +0300 Message-ID: <878uz0n8ix.fsf@intel.com> References: <20130912171523.GD12961@nuc-i3427.alporthouse.com> <1379019832-1526-1-git-send-email-przanoni@gmail.com> <871u4tnkku.fsf@intel.com> <20130913125303.GB24404@strange.amr.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTP id 00CE4E8171 for ; Fri, 13 Sep 2013 06:39:34 -0700 (PDT) In-Reply-To: <20130913125303.GB24404@strange.amr.corp.intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: Damien Lespiau Cc: intel-gfx@lists.freedesktop.org, Paulo Zanoni List-Id: intel-gfx@lists.freedesktop.org On Fri, 13 Sep 2013, Damien Lespiau wrote: > On Fri, Sep 13, 2013 at 12:21:21PM +0300, Jani Nikula wrote: >> On Fri, 13 Sep 2013, Paulo Zanoni wrote: >> > From: Paulo Zanoni >> > >> > So far we control all the reads an none of them exceeds the current >> > limit of 20 bytes, but we never think about this when reviewing >> > patches, so we may at some point in the future overflow the buffer. >> > >> > My initial patch just added a WARN in case we were about to overflow >> > the buffer, but Chris suggested to make the size of the array dynamic. >> >> VLA on stack in kernel gives me an uneasy feeling, but I'll survive. > > IIRC sparse will complain about this. Might worth double checking. True. CHECK drivers/gpu/drm/i915/intel_dp.c drivers/gpu/drm/i915/intel_dp.c:567:34: error: bad constant expression -- Jani Nikula, Intel Open Source Technology Center