diff options
author | Mikko Perttunen <mperttunen@nvidia.com> | 2018-06-20 09:03:58 -0400 |
---|---|---|
committer | Thierry Reding <treding@nvidia.com> | 2018-07-09 04:33:45 -0400 |
commit | 5265f0338bc0feec6c0d544dfe005dec1a93cb93 (patch) | |
tree | 207c3c849a78c3f20cb879794cc774477588f91c /drivers | |
parent | ec58923215dbbeef59ee82923ee94d745f73db58 (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 <mperttunen@nvidia.com>
Reviewed-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/tegra/drm.c | 2 |
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, | |||
398 | * unaligned offset is malformed and cause commands stream | 398 | * unaligned offset is malformed and cause commands stream |
399 | * corruption on the buffer address relocation. | 399 | * corruption on the buffer address relocation. |
400 | */ | 400 | */ |
401 | if (offset & 3 || offset >= obj->gem.size) { | 401 | if (offset & 3 || offset > obj->gem.size) { |
402 | err = -EINVAL; | 402 | err = -EINVAL; |
403 | goto fail; | 403 | goto fail; |
404 | } | 404 | } |