From: Jani Nikula <jani.nikula@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: jani.nikula@intel.com
Subject: [PATCH RESEND 7/7] drm/i915/dsi: double check element parsing against size if present
Date: Mon, 13 Jun 2016 13:22:18 +0300 [thread overview]
Message-ID: <1465813338-6706-7-git-send-email-jani.nikula@intel.com> (raw)
In-Reply-To: <1465813338-6706-1-git-send-email-jani.nikula@intel.com>
Be a little paranoid in case the specs change or something.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
drivers/gpu/drm/i915/intel_dsi_panel_vbt.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c b/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c
index d078c5765014..30fcb02fce9b 100644
--- a/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c
+++ b/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c
@@ -441,7 +441,15 @@ static void generic_exec_sequence(struct drm_panel *panel, enum mipi_seq seq_id)
operation_size = *data++;
if (mipi_elem_exec) {
+ const u8 *next = data + operation_size;
+
data = mipi_elem_exec(intel_dsi, data);
+
+ /* Consistency check if we have size. */
+ if (operation_size && data != next) {
+ DRM_ERROR("Inconsistent operation size\n");
+ return;
+ }
} else if (operation_size) {
/* We have size, skip. */
DRM_DEBUG_KMS("Unsupported MIPI operation byte %u\n",
--
2.1.4
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2016-06-13 10:22 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-13 10:22 [PATCH RESEND 1/7] drm/i915/dsi: don't debug log "missing" sequences Jani Nikula
2016-06-13 10:22 ` [PATCH RESEND 2/7] drm/i915/dsi: add debug logging to element execution Jani Nikula
2016-06-13 10:22 ` [PATCH RESEND 3/7] drm/i915/dsi: add skip functions for spi and pmic elements Jani Nikula
2016-06-16 14:56 ` Ville Syrjälä
2016-06-13 10:22 ` [PATCH RESEND 4/7] drm/i915/dsi: run power on/off sequences in panel prepare/unprepare hooks Jani Nikula
2016-06-16 15:54 ` Ville Syrjälä
2016-06-13 10:22 ` [PATCH RESEND 5/7] drm/i915/dsi: run backlight on/off sequences in panel enable/disable hooks Jani Nikula
2016-06-13 10:22 ` [PATCH RESEND 6/7] drm/i915/bios: log about presence of DSI sequences we do not run Jani Nikula
2016-06-13 10:22 ` Jani Nikula [this message]
2016-06-13 10:52 ` ✓ Ro.CI.BAT: success for series starting with [RESEND,1/7] drm/i915/dsi: don't debug log "missing" sequences 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=1465813338-6706-7-git-send-email-jani.nikula@intel.com \
--to=jani.nikula@intel.com \
--cc=intel-gfx@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