]> rtime.felk.cvut.cz Git - hercules2020/nv-tegra/linux-4.4.git/blobdiff - drivers/media/i2c/adv7511.c
drivers: speculative load before bound-check
[hercules2020/nv-tegra/linux-4.4.git] / drivers / media / i2c / adv7511.c
index c24839cfcc3565ca83de9f4e6aeba8a9d57d46a2..a10fb95a0c63b437750ff858c459fe1bd7332ef9 100644 (file)
@@ -33,6 +33,7 @@
 #include <media/v4l2-ctrls.h>
 #include <media/v4l2-dv-timings.h>
 #include <media/adv7511.h>
+#include <asm/barrier.h>
 
 static int debug;
 module_param(debug, int, 0644);
@@ -908,6 +909,8 @@ static int adv7511_get_edid(struct v4l2_subdev *sd, struct v4l2_edid *edid)
 
        if (edid->start_block >= state->edid.segments * 2)
                return -EINVAL;
+       
+       speculation_barrier();
 
        if (edid->start_block + edid->blocks > state->edid.segments * 2)
                edid->blocks = state->edid.segments * 2 - edid->start_block;