drm/i915: don't leak the pin_map on error
Subsystems (2)
PATCH 1/1 drm/i915: don't leak the pin_map on error
Add some onion to populate_lr_context.
--- drivers/gpu/drm/i915/intel_lrc.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/intel_lrc.c +6 -4
@@ -2318,8 +2318,10 @@ populate_lr_context(struct i915_gem_context *ctx, defaults =i915_gem_object_pin_map (engine->default_state,I915_MAP_WB ); -if (IS_ERR (defaults)) -return PTR_ERR (defaults); +if (IS_ERR (defaults)) { + ret =PTR_ERR (defaults); + goto error; + }memcpy (vaddr + start, defaults + start, engine->context_size);i915_gem_object_unpin_map (engine->default_state);
@@ -2337,9 +2339,9 @@ populate_lr_context(struct i915_gem_context *ctx,_MASKED_BIT_ENABLE (CTX_CTRL_ENGINE_CTX_RESTORE_INHIBIT |CTX_CTRL_ENGINE_CTX_SAVE_INHIBIT ); +error:i915_gem_object_unpin_map (ctx_obj); - -return 0 ; +return ret; } static int execlists_context_deferred_alloc(struct i915_gem_context *ctx,
Signature · 6 lines
2.14.3 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoting Matthew Auld (2018-03-01 10:18:55)
Quoted 5 lines
Add some onion to
populate_lr_context.Fixes d2b4b97933f5 ("drm/i915: Record the default hw state after reset upon load")Signed-off-by Matthew Auld <[email protected]>Cc Chris Wilson <[email protected]>
Worth backporting? Not sure, as the leak will be forcibly freed when the context is freed. We should spit a warning in that case, which as you haven't quoted I presume this was found by inspection rather than hit?
Quoted 21 lines
drivers/gpu/drm/i915/intel_lrc.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)drivers/gpu/drm/i915/intel_lrc.c +4
-2@@ -2318,8 +2318,10 @@ populate_lr_context(struct i915_gem_context *ctx, defaults =i915_gem_object_pin_map (engine->default_state,I915_MAP_WB ); -if (IS_ERR (defaults)) -return PTR_ERR (defaults); +if (IS_ERR (defaults)) { + ret =PTR_ERR (defaults); + goto error; + }memcpy (vaddr + start, defaults + start, engine->context_size);i915_gem_object_unpin_map (engine->default_state);
drivers/gpu/drm/i915/intel_lrc.c populate_lr_context(struct i915_gem_context *ctx, · line 2342
Quoted 4 lines
drivers/gpu/drm/i915/intel_lrc.c +1
-0@@ -2337,9 +2339,9 @@ populate_lr_context(struct i915_gem_context *ctx,_MASKED_BIT_ENABLE (CTX_CTRL_ENGINE_CTX_RESTORE_INHIBIT |CTX_CTRL_ENGINE_CTX_SAVE_INHIBIT ); +error:
err_unpin_ctx: or out_unpin_ctx: if Joonas is listening.
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 14 lines · Matthew Auld
Add some onion to
populate_lr_context.Fixes d2b4b97933f5 ("drm/i915: Record the default hw state after reset upon load")Signed-off-by Matthew Auld <[email protected]>Cc Chris Wilson <[email protected]>--- drivers/gpu/drm/i915/intel_lrc.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)drivers/gpu/drm/i915/intel_lrc.c +0
-0
drivers/gpu/drm/i915/intel_lrc.c populate_lr_context(struct i915_gem_context *ctx, · line 2323
Quoted 8 lines
drivers/gpu/drm/i915/intel_lrc.c +3
-2@@ -2318,8 +2318,10 @@ populate_lr_context(struct i915_gem_context *ctx, defaults =i915_gem_object_pin_map (engine->default_state,I915_MAP_WB ); -if (IS_ERR (defaults)) -return PTR_ERR (defaults); +if (IS_ERR (defaults)) { + ret =PTR_ERR (defaults); + goto error;
I would have used goto unpin_out or error_unpin. This way you can read both parts separately and don't have to go back and forth pairing the parts of onion. Just a stylistic note and as this is the only goto in this func so we can improve if it ever grows.
Quoted 23 lines
drivers/gpu/drm/i915/intel_lrc.c +3
-2+ }memcpy (vaddr + start, defaults + start, engine->context_size);i915_gem_object_unpin_map (engine->default_state);@@ -2337,9 +2339,9 @@ populate_lr_context(struct i915_gem_context *ctx,_MASKED_BIT_ENABLE (CTX_CTRL_ENGINE_CTX_RESTORE_INHIBIT |CTX_CTRL_ENGINE_CTX_SAVE_INHIBIT ); +error:i915_gem_object_unpin_map (ctx_obj); - -return 0 ; +return ret; } static int execlists_context_deferred_alloc(struct i915_gem_context *ctx,Signature · 6 lines
2.14.3 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.BAT: success for drm/i915: don't leak the pin_map on error
In reply to Matthew Auld== Series Details ==
== Series Details ==
Series: drm/i915: don't leak the pin_map on error
URL : https://patchwork.freedesktop.org/series/39207/
State : success
== Summary ==
Series 39207v1 drm/i915: don't leak the pin_map on error
https://patchwork.freedesktop.org/api/1.0/series/39207/revisions/1/mbox/
---- Known issues:
Test debugfs_test:
Subgroup read_all_entries:
incomplete -> PASS (fi-snb-2520m) fdo#103713
Test kms_chamelium:
Subgroup dp-crc-fast:
pass -> DMESG-FAIL (fi-kbl-7500u) fdo#103841
Subgroup dp-edid-read:
pass -> FAIL (fi-kbl-7500u) fdo#102505
Test prime_vgem:
Subgroup basic-fence-flip:
fail -> PASS (fi-ilk-650) fdo#104008fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713
fdo#103841 https://bugs.freedesktop.org/show_bug.cgi?id=103841
fdo#102505 https://bugs.freedesktop.org/show_bug.cgi?id=102505
fdo#104008 https://bugs.freedesktop.org/show_bug.cgi?id=104008
fi-bdw-5557u total:288 pass:267 dwarn:0 dfail:0 fail:0 skip:21 time:414s fi-bdw-gvtdvm total:288 pass:264 dwarn:0 dfail:0 fail:0 skip:24 time:422s fi-blb-e6850 total:288 pass:223 dwarn:1 dfail:0 fail:0 skip:64 time:371s fi-bsw-n3050 total:288 pass:242 dwarn:0 dfail:0 fail:0 skip:46 time:477s fi-bwr-2160 total:288 pass:183 dwarn:0 dfail:0 fail:0 skip:105 time:277s fi-bxt-dsi total:288 pass:258 dwarn:0 dfail:0 fail:0 skip:30 time:476s fi-bxt-j4205 total:288 pass:259 dwarn:0 dfail:0 fail:0 skip:29 time:484s fi-byt-j1900 total:288 pass:253 dwarn:0 dfail:0 fail:0 skip:35 time:463s fi-byt-n2820 total:288 pass:249 dwarn:0 dfail:0 fail:0 skip:39 time:451s fi-cfl-8700k total:288 pass:260 dwarn:0 dfail:0 fail:0 skip:28 time:388s fi-cfl-s2 total:288 pass:262 dwarn:0 dfail:0 fail:0 skip:26 time:561s fi-elk-e7500 total:288 pass:229 dwarn:0 dfail:0 fail:0 skip:59 time:415s fi-gdg-551 total:288 pass:180 dwarn:0 dfail:0 fail:0 skip:108 time:289s fi-glk-1 total:288 pass:260 dwarn:0 dfail:0 fail:0 skip:28 time:508s fi-hsw-4770 total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:385s fi-ilk-650 total:288 pass:228 dwarn:0 dfail:0 fail:0 skip:60 time:409s fi-ivb-3520m total:288 pass:259 dwarn:0 dfail:0 fail:0 skip:29 time:450s fi-ivb-3770 total:288 pass:255 dwarn:0 dfail:0 fail:0 skip:33 time:409s fi-kbl-7500u total:288 pass:261 dwarn:1 dfail:1 fail:1 skip:24 time:448s fi-kbl-7560u total:288 pass:269 dwarn:0 dfail:0 fail:0 skip:19 time:490s fi-kbl-7567u total:288 pass:268 dwarn:0 dfail:0 fail:0 skip:20 time:452s fi-kbl-r total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:492s fi-pnv-d510 total:288 pass:222 dwarn:1 dfail:0 fail:0 skip:65 time:587s fi-skl-6260u total:288 pass:268 dwarn:0 dfail:0 fail:0 skip:20 time:421s fi-skl-6600u total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:501s fi-skl-6700hq total:288 pass:262 dwarn:0 dfail:0 fail:0 skip:26 time:520s fi-skl-6700k2 total:288 pass:264 dwarn:0 dfail:0 fail:0 skip:24 time:487s fi-skl-6770hq total:288 pass:268 dwarn:0 dfail:0 fail:0 skip:20 time:476s fi-skl-guc total:288 pass:260 dwarn:0 dfail:0 fail:0 skip:28 time:407s fi-skl-gvtdvm total:288 pass:265 dwarn:0 dfail:0 fail:0 skip:23 time:429s fi-snb-2520m total:288 pass:248 dwarn:0 dfail:0 fail:0 skip:40 time:522s fi-snb-2600 total:288 pass:248 dwarn:0 dfail:0 fail:0 skip:40 time:393s
4f93bc69c016e696a7ea97c6f894d9bab8a905d8 drm-tip: 2018y-03m-01d-09h-30m-35s UTC integration manifest 82bf88c2b4c7 drm/i915: don't leak the pin_map on error
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_8195/issues.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 1/1 drm/i915: don't leak the pin_map on error
In reply to Matthew AuldAdd some onion to populate_lr_context.
v2: prefer err_unpin_ctx
drop the fixes tag, worst case we just spew a warn before everything is cleaned up and balance is restored
--- drivers/gpu/drm/i915/intel_lrc.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/intel_lrc.c +6 -4
@@ -2318,8 +2318,10 @@ populate_lr_context(struct i915_gem_context *ctx, defaults =i915_gem_object_pin_map (engine->default_state,I915_MAP_WB ); -if (IS_ERR (defaults)) -return PTR_ERR (defaults); +if (IS_ERR (defaults)) { + ret =PTR_ERR (defaults); + goto err_unpin_ctx; + }memcpy (vaddr + start, defaults + start, engine->context_size);i915_gem_object_unpin_map (engine->default_state);
@@ -2337,9 +2339,9 @@ populate_lr_context(struct i915_gem_context *ctx,_MASKED_BIT_ENABLE (CTX_CTRL_ENGINE_CTX_RESTORE_INHIBIT |CTX_CTRL_ENGINE_CTX_SAVE_INHIBIT ); +err_unpin_ctx:i915_gem_object_unpin_map (ctx_obj); - -return 0 ; +return ret; } static int execlists_context_deferred_alloc(struct i915_gem_context *ctx,
Signature · 6 lines
2.14.3 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoting Matthew Auld (2018-03-01 11:46:39)
Quoted 10 lines
Add some onion to
populate_lr_context.v2: prefer
err_unpin_ctx
drop the fixes tag, worst case we just spew a warn before everything is cleaned up and balance is restoredSigned-off-by Matthew Auld <[email protected]>Cc Chris Wilson <[email protected]>Reviewed-by Chris Wilson <[email protected]>Reviewed-by Mika Kuoppala <[email protected]>
And pushed. Thanks for the patch,
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.BAT: success for drm/i915: don't leak the pin_map on error (rev2)
In reply to Matthew Auld== Series Details ==
== Series Details ==
Series: drm/i915: don't leak the pin_map on error (rev2)
URL : https://patchwork.freedesktop.org/series/39207/
State : success
== Summary ==
Series 39207v2 drm/i915: don't leak the pin_map on error
https://patchwork.freedesktop.org/api/1.0/series/39207/revisions/2/mbox/
---- Known issues:
Test kms_chamelium:
Subgroup hdmi-hpd-fast:
fail -> SKIP (fi-kbl-7500u) fdo#105310 +4
Test kms_pipe_crc_basic:
Subgroup suspend-read-crc-pipe-b:
incomplete -> PASS (fi-snb-2520m) fdo#103713fdo#105310 https://bugs.freedesktop.org/show_bug.cgi?id=105310
fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713
fi-bdw-5557u total:288 pass:267 dwarn:0 dfail:0 fail:0 skip:21 time:419s fi-bdw-gvtdvm total:288 pass:264 dwarn:0 dfail:0 fail:0 skip:24 time:421s fi-blb-e6850 total:288 pass:223 dwarn:1 dfail:0 fail:0 skip:64 time:370s fi-bsw-n3050 total:288 pass:242 dwarn:0 dfail:0 fail:0 skip:46 time:479s fi-bwr-2160 total:288 pass:183 dwarn:0 dfail:0 fail:0 skip:105 time:278s fi-bxt-dsi total:288 pass:258 dwarn:0 dfail:0 fail:0 skip:30 time:479s fi-bxt-j4205 total:288 pass:259 dwarn:0 dfail:0 fail:0 skip:29 time:485s fi-byt-j1900 total:288 pass:253 dwarn:0 dfail:0 fail:0 skip:35 time:463s fi-byt-n2820 total:288 pass:249 dwarn:0 dfail:0 fail:0 skip:39 time:454s fi-cfl-8700k total:288 pass:260 dwarn:0 dfail:0 fail:0 skip:28 time:392s fi-cfl-s2 total:288 pass:262 dwarn:0 dfail:0 fail:0 skip:26 time:560s fi-cnl-y3 total:288 pass:262 dwarn:0 dfail:0 fail:0 skip:26 time:573s fi-elk-e7500 total:288 pass:229 dwarn:0 dfail:0 fail:0 skip:59 time:407s fi-gdg-551 total:288 pass:179 dwarn:0 dfail:0 fail:1 skip:108 time:289s fi-glk-1 total:288 pass:260 dwarn:0 dfail:0 fail:0 skip:28 time:507s fi-hsw-4770 total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:385s fi-ilk-650 total:288 pass:228 dwarn:0 dfail:0 fail:0 skip:60 time:408s fi-ivb-3520m total:288 pass:259 dwarn:0 dfail:0 fail:0 skip:29 time:455s fi-ivb-3770 total:288 pass:255 dwarn:0 dfail:0 fail:0 skip:33 time:410s fi-kbl-7500u total:288 pass:260 dwarn:0 dfail:0 fail:4 skip:24 time:482s fi-kbl-7560u total:288 pass:269 dwarn:0 dfail:0 fail:0 skip:19 time:488s fi-kbl-7567u total:288 pass:268 dwarn:0 dfail:0 fail:0 skip:20 time:451s fi-kbl-r total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:489s fi-pnv-d510 total:288 pass:222 dwarn:1 dfail:0 fail:0 skip:65 time:582s fi-skl-6260u total:288 pass:268 dwarn:0 dfail:0 fail:0 skip:20 time:425s fi-skl-6600u total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:502s fi-skl-6700hq total:288 pass:262 dwarn:0 dfail:0 fail:0 skip:26 time:516s fi-skl-6700k2 total:288 pass:264 dwarn:0 dfail:0 fail:0 skip:24 time:487s fi-skl-6770hq total:288 pass:268 dwarn:0 dfail:0 fail:0 skip:20 time:492s fi-skl-guc total:288 pass:260 dwarn:0 dfail:0 fail:0 skip:28 time:406s fi-skl-gvtdvm total:288 pass:265 dwarn:0 dfail:0 fail:0 skip:23 time:428s fi-snb-2520m total:288 pass:248 dwarn:0 dfail:0 fail:0 skip:40 time:519s fi-snb-2600 total:288 pass:248 dwarn:0 dfail:0 fail:0 skip:40 time:390s
Blacklisted hosts:
fi-cfl-u total:288 pass:262 dwarn:0 dfail:0 fail:0 skip:26 time:496s
61da3e8943e4b5e643e3d72f3a925227fe4cb84c drm-tip: 2018y-03m-01d-13h-30m-46s UTC integration manifest f4d55bef5760 drm/i915: don't leak the pin_map on error
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_8198/issues.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.IGT: success for drm/i915: don't leak the pin_map on error
In reply to Matthew Auld== Series Details ==
== Series Details ==
Series: drm/i915: don't leak the pin_map on error
URL : https://patchwork.freedesktop.org/series/39207/
State : success
== Summary ==
---- Known issues:
Test gem_eio:
Subgroup in-flight-contexts:
incomplete -> PASS (shard-apl) fdo#104945
Test kms_chv_cursor_fail:
Subgroup pipe-b-256x256-right-edge:
dmesg-warn -> PASS (shard-snb) fdo#105185
Test kms_cursor_crc:
Subgroup cursor-256x256-suspend:
pass -> DMESG-WARN (shard-snb) fdo#103375
Test kms_flip:
Subgroup 2x-plain-flip-fb-recreate-interruptible:
pass -> FAIL (shard-hsw) fdo#100368
Test kms_frontbuffer_tracking:
Subgroup fbc-1p-offscren-pri-shrfb-draw-render:
pass -> DMESG-FAIL (shard-apl) fdo#101623
Test kms_sysfs_edid_timing:
pass -> WARN (shard-apl) fdo#100047
Test perf:
Subgroup oa-exponents:
pass -> INCOMPLETE (shard-apl) fdo#102254fdo#104945 https://bugs.freedesktop.org/show_bug.cgi?id=104945
fdo#105185 https://bugs.freedesktop.org/show_bug.cgi?id=105185
fdo#103375 https://bugs.freedesktop.org/show_bug.cgi?id=103375
fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#101623 https://bugs.freedesktop.org/show_bug.cgi?id=101623
fdo#100047 https://bugs.freedesktop.org/show_bug.cgi?id=100047
fdo#102254 https://bugs.freedesktop.org/show_bug.cgi?id=102254
shard-apl total:3447 pass:1810 dwarn:1 dfail:1 fail:7 skip:1626 time:11875s shard-hsw total:3460 pass:1766 dwarn:1 dfail:0 fail:2 skip:1690 time:11727s shard-snb total:3460 pass:1358 dwarn:2 dfail:0 fail:1 skip:2099 time:6637s
Blacklisted hosts:
shard-kbl total:3460 pass:1935 dwarn:1 dfail:0 fail:14 skip:1510 time:9510s
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_8195/shards.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.IGT: warning for drm/i915: don't leak the pin_map on error (rev2)
In reply to Matthew Auld== Series Details ==
== Series Details ==
Series: drm/i915: don't leak the pin_map on error (rev2)
URL : https://patchwork.freedesktop.org/series/39207/
State : warning
== Summary ==
---- Possible new issues:
Test kms_frontbuffer_tracking:
Subgroup fbc-1p-offscren-pri-shrfb-draw-mmap-gtt:
dmesg-fail -> PASS (shard-apl)
Test kms_vblank:
Subgroup pipe-a-query-forked:
pass -> SKIP (shard-snb)---- Known issues:
Test gem_eio:
Subgroup in-flight:
pass -> INCOMPLETE (shard-apl) fdo#104945
Test kms_chv_cursor_fail:
Subgroup pipe-b-256x256-top-edge:
dmesg-warn -> PASS (shard-snb) fdo#105185 +2
Test kms_cursor_crc:
Subgroup cursor-256x256-suspend:
pass -> INCOMPLETE (shard-hsw) fdo#103375
Test kms_flip:
Subgroup 2x-flip-vs-expired-vblank-interruptible:
fail -> PASS (shard-hsw) fdo#102887
Subgroup plain-flip-ts-check:
pass -> FAIL (shard-hsw) fdo#100368
Test kms_frontbuffer_tracking:
Subgroup fbc-1p-offscren-pri-indfb-draw-render:
fail -> PASS (shard-apl) fdo#103167 +1
Test perf:
Subgroup oa-exponents:
pass -> INCOMPLETE (shard-apl) fdo#102254fdo#104945 https://bugs.freedesktop.org/show_bug.cgi?id=104945
fdo#105185 https://bugs.freedesktop.org/show_bug.cgi?id=105185
fdo#103375 https://bugs.freedesktop.org/show_bug.cgi?id=103375
fdo#102887 https://bugs.freedesktop.org/show_bug.cgi?id=102887
fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
fdo#102254 https://bugs.freedesktop.org/show_bug.cgi?id=102254
shard-apl total:3354 pass:1765 dwarn:1 dfail:0 fail:7 skip:1578 time:11437s shard-hsw total:3456 pass:1762 dwarn:1 dfail:0 fail:3 skip:1688 time:11089s shard-snb total:3461 pass:1358 dwarn:1 dfail:0 fail:1 skip:2101 time:6611s
Blacklisted hosts:
shard-kbl total:3407 pass:1915 dwarn:3 dfail:0 fail:7 skip:1481 time:9275s
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_8198/shards.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx