Skip to content

Commit 9bf4303

Browse files
committed
Merge branch 'etnaviv/fixes' of https://git.pengutronix.de/git/lst/linux 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 <[email protected]> From: Lucas Stach <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 parents 5a3f610 + ad99cb5 commit 9bf4303

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,10 @@ static int submit_pin_objects(struct etnaviv_gem_submit *submit)
238238
}
239239

240240
if ((submit->flags & ETNA_SUBMIT_SOFTPIN) &&
241-
submit->bos[i].va != mapping->iova)
241+
submit->bos[i].va != mapping->iova) {
242+
etnaviv_gem_mapping_unreference(mapping);
242243
return -EINVAL;
244+
}
243245

244246
atomic_inc(&etnaviv_obj->gpu_active);
245247

drivers/gpu/drm/etnaviv/etnaviv_perfmon.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ static const struct etnaviv_pm_domain *pm_domain(const struct etnaviv_gpu *gpu,
453453
if (!(gpu->identity.features & meta->feature))
454454
continue;
455455

456-
if (meta->nr_domains < (index - offset)) {
456+
if (index - offset >= meta->nr_domains) {
457457
offset += meta->nr_domains;
458458
continue;
459459
}

0 commit comments

Comments
 (0)