From: Simon Glass Date: Wed, 7 Jun 2017 10:28:39 -0600 Subject: [U-Boot] [PATCH 02/10] edid: Use sizeof() in cea_is_hdmi_vsdb_present() In-Reply-To: <20170607162847.16971-1-sjg@chromium.org> References: <20170607162847.16971-1-sjg@chromium.org> Message-ID: <20170607162847.16971-3-sjg@chromium.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de We should not use an open-coded value here. Use sizeof() instead. Signed-off-by: Simon Glass Reported-by: Coverity (CID: 163252) Fixes: 43c6bdd0 (edid: Add HDMI flag to timing info) --- common/edid.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/edid.c b/common/edid.c index 19410aa4fc..94b33aee18 100644 --- a/common/edid.c +++ b/common/edid.c @@ -148,8 +148,8 @@ static bool cea_is_hdmi_vsdb_present(struct edid_cea861_info *info) /* check for end of data block */ end = info->dtd_offset; if (end == 0) - end = 127; - if (end < 4 || end > 127) + end = sizeof(info->data); + if (end < 4 || end > sizeof(info->data)) return false; end -= 4; -- 2.13.0.506.g27d5fe0cd-goog