drm/tegra: Fix comparison operator for buffer size
Mikko Perttunen
maintainerPATCH 1/1 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.
--- drivers/gpu/drm/tegra/drm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/tegra/drm.c +1 -1
@@ -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; }
Signature · 6 lines
2.16.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 14 lines · On Wednesday, 20 June 2018 16:03:58 MSK Mikko Perttunen wrote:
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]>--- drivers/gpu/drm/tegra/drm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/tegra/drm.c +0
-0
drivers/gpu/drm/tegra/drm.c int tegra_drm_submit(struct tegra_drm_context *context, · line 404
Quoted 8 lines
drivers/gpu/drm/tegra/drm.c +1
-1@@ -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; }
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Thierry Reding
AppliedQuoted 8 lines · Mikko Perttunen
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]>--- drivers/gpu/drm/tegra/drm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Applied, thanks.
Thierry
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel