public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t 2/3] tools/intel_vbt_decode: Check the number of bytes dumped for the mipi seq operation
Date: Fri,  8 Mar 2019 16:57:27 +0200	[thread overview]
Message-ID: <20190308145728.18573-2-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20190308145728.18573-1-ville.syrjala@linux.intel.com>

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Cross check the return value from the mipi seq dump function and the
size of the operation declared in the sequence (for v3+ sequence block).

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 tools/intel_vbt_decode.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/tools/intel_vbt_decode.c b/tools/intel_vbt_decode.c
index 2c71f0846c15..5742081ea29a 100644
--- a/tools/intel_vbt_decode.c
+++ b/tools/intel_vbt_decode.c
@@ -1286,7 +1286,14 @@ static const uint8_t *dump_sequence(const uint8_t *data, uint8_t seq_version)
 			operation_size = *data++;
 
 		if (mipi_elem_dump) {
-			data = mipi_elem_dump(data, seq_version);
+			const u8 *next;
+
+			next = mipi_elem_dump(data, seq_version);
+			if (operation_size)
+				data += operation_size;
+			else
+				data = next;
+			assert(next == data);
 		} else if (operation_size) {
 			/* We have size, skip. */
 			data += operation_size;
-- 
2.19.2

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

  reply	other threads:[~2019-03-08 14:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-08 14:57 [igt-dev] [PATCH i-g-t 1/3] tools/intel_vbt_decode: Correctly decode v3 GPIO sequence Ville Syrjala
2019-03-08 14:57 ` Ville Syrjala [this message]
2019-03-08 14:57 ` [igt-dev] [PATCH i-g-t 3/3] tools/intel_vbt_decode: Dump the GPIO value/config/flag as a raw hex byte Ville Syrjala
2019-03-08 19:27   ` Jani Nikula
2019-03-08 19:27 ` [igt-dev] [PATCH i-g-t 1/3] tools/intel_vbt_decode: Correctly decode v3 GPIO sequence Jani Nikula
2019-03-08 20:44 ` [igt-dev] ✗ Fi.CI.BAT: failure for series starting with [i-g-t,1/3] " 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=20190308145728.18573-2-ville.syrjala@linux.intel.com \
    --to=ville.syrjala@linux.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