aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikko Perttunen <[email protected]>2018-06-20 16:03:58 +0300
committerThierry Reding <[email protected]>2018-07-09 10:33:45 +0200
commit5265f0338bc0feec6c0d544dfe005dec1a93cb93 (patch)
tree207c3c849a78c3f20cb879794cc774477588f91c
parentec58923215dbbeef59ee82923ee94d745f73db58 (diff)
drm/tegra: Fix comparison operator for buffer size
Here we are checking for the buffer length, not an offset for writing to, so using > is correct. The current code incorrectly rejects a command buffer ending at the memory buffer's end. Signed-off-by: Mikko Perttunen <[email protected]> Reviewed-by: Dmitry Osipenko <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
-rw-r--r--drivers/gpu/drm/tegra/drm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c
index 776c1513e582..a2bd5876c633 100644
--- a/drivers/gpu/drm/tegra/drm.c
+++ b/drivers/gpu/drm/tegra/drm.c
@@ -398,7 +398,7 @@ int tegra_drm_submit(struct tegra_drm_context *context,
* unaligned offset is malformed and cause commands stream
* corruption on the buffer address relocation.
*/
- if (offset & 3 || offset >= obj->gem.size) {
+ if (offset & 3 || offset > obj->gem.size) {
err = -EINVAL;
goto fail;
}