mirror of
https://github.com/torvalds/linux.git
synced 2024-12-26 21:02:19 +00:00
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>
This commit is contained in:
parent
ec58923215
commit
5265f0338b
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user