summaryrefslogtreecommitdiffstats
path: root/include/drm/drm_dp_mst_helper.h
diff options
context:
space:
mode:
authorDave Airlie2015-10-14 10:51:17 +0200
committerDave Airlie2015-10-15 01:06:20 +0200
commitae491542cbbbcca0ec8938c37d4079a985e58440 (patch)
treee0e7c931aee2edae9b3ce5a9689106557204de8c /include/drm/drm_dp_mst_helper.h
parentdrm/radeon: attach tile property to mst connector (diff)
downloadkernel-qcow2-linux-ae491542cbbbcca0ec8938c37d4079a985e58440.tar.gz
kernel-qcow2-linux-ae491542cbbbcca0ec8938c37d4079a985e58440.tar.xz
kernel-qcow2-linux-ae491542cbbbcca0ec8938c37d4079a985e58440.zip
drm/dp/mst: make mst i2c transfer code more robust.
This zeroes the msg so no random stack data ends up getting sent, it also limits the function to not accepting > 4 i2c msgs. Cc: stable@vger.kernel.org Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'include/drm/drm_dp_mst_helper.h')
-rw-r--r--include/drm/drm_dp_mst_helper.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/drm/drm_dp_mst_helper.h b/include/drm/drm_dp_mst_helper.h
index 0f408b002d98..5340099741ae 100644
--- a/include/drm/drm_dp_mst_helper.h
+++ b/include/drm/drm_dp_mst_helper.h
@@ -253,6 +253,7 @@ struct drm_dp_remote_dpcd_write {
u8 *bytes;
};
+#define DP_REMOTE_I2C_READ_MAX_TRANSACTIONS 4
struct drm_dp_remote_i2c_read {
u8 num_transactions;
u8 port_number;
@@ -262,7 +263,7 @@ struct drm_dp_remote_i2c_read {
u8 *bytes;
u8 no_stop_bit;
u8 i2c_transaction_delay;
- } transactions[4];
+ } transactions[DP_REMOTE_I2C_READ_MAX_TRANSACTIONS];
u8 read_i2c_device_id;
u8 num_bytes_read;
};