Skip to content

Commit

Permalink
Merge branch 'etnaviv/fixes' of https://git.pengutronix.de/git/lst/linux
Browse files Browse the repository at this point in the history
 into drm-fixes

two fixes:
- memory leak fix when userspace passes a invalid softpin address
- off-by-one crashing the kernel in the perfmon domain iteration when
the GPU core has both 2D and 3D capabilities

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Lucas Stach <l.stach@pengutronix.de>
Link: https://patchwork.freedesktop.org/patch/msgid/ca7bce5c8aff0fcbbdc3bf2b9723df5f687c8924.camel@pengutronix.de
  • Loading branch information
Dave Airlie committed May 22, 2020
2 parents 5a3f610 + ad99cb5 commit 9bf4303
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,10 @@ static int submit_pin_objects(struct etnaviv_gem_submit *submit)
}

if ((submit->flags & ETNA_SUBMIT_SOFTPIN) &&
submit->bos[i].va != mapping->iova)
submit->bos[i].va != mapping->iova) {
etnaviv_gem_mapping_unreference(mapping);
return -EINVAL;
}

atomic_inc(&etnaviv_obj->gpu_active);

Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/etnaviv/etnaviv_perfmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ static const struct etnaviv_pm_domain *pm_domain(const struct etnaviv_gpu *gpu,
if (!(gpu->identity.features & meta->feature))
continue;

if (meta->nr_domains < (index - offset)) {
if (index - offset >= meta->nr_domains) {
offset += meta->nr_domains;
continue;
}
Expand Down

0 comments on commit 9bf4303

Please sign in to comment.