public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: jani.nikula@intel.com
Subject: [igt-dev] [PATCH i-g-t 2/2] tools/intel_vbt_decode: check inconsistent sequence element size
Date: Fri,  8 Mar 2019 21:01:07 +0200	[thread overview]
Message-ID: <20190308190107.32514-2-jani.nikula@intel.com> (raw)
In-Reply-To: <20190308190107.32514-1-jani.nikula@intel.com>

Cross check against the element dumper return value to catch
inconsistencies.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 tools/intel_vbt_decode.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tools/intel_vbt_decode.c b/tools/intel_vbt_decode.c
index de4cc88a06dd..5f3db808d70d 100644
--- a/tools/intel_vbt_decode.c
+++ b/tools/intel_vbt_decode.c
@@ -1289,7 +1289,13 @@ static const uint8_t *dump_sequence(const uint8_t *data, uint8_t seq_version)
 			operation_size = *data++;
 
 		if (mipi_elem_dump) {
+			const uint8_t *next = data + operation_size;
+
 			data = mipi_elem_dump(data, seq_version);
+
+			if (operation_size && next != data)
+				printf("Error: Inconsistent operation size: %d\n",
+					operation_size);
 		} else if (operation_size) {
 			/* We have size, skip. */
 			data += operation_size;
-- 
2.20.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  reply	other threads:[~2019-03-08 19:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-08 19:01 [igt-dev] [PATCH i-g-t 1/2] tools/intel_vbt_decode: fix mipi gpio element dumping for sequence v3 Jani Nikula
2019-03-08 19:01 ` Jani Nikula [this message]
2019-03-08 19:09   ` [igt-dev] [PATCH i-g-t 2/2] tools/intel_vbt_decode: check inconsistent sequence element size Ville Syrjälä
2019-03-08 19:28     ` Jani Nikula
2019-03-09  1:42 ` [igt-dev] ✗ Fi.CI.BAT: failure for series starting with [i-g-t,1/2] tools/intel_vbt_decode: fix mipi gpio element dumping for sequence v3 Patchwork

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=20190308190107.32514-2-jani.nikula@intel.com \
    --to=jani.nikula@intel.com \
    --cc=igt-dev@lists.freedesktop.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox