Commit 4a61648
drm/i915/gvt: fix double free bug in split_2MB_gtt_entry
If intel_gvt_dma_map_guest_page failed, it will call
ppgtt_invalidate_spt, which will finally free the spt.
But the caller function ppgtt_populate_spt_by_guest_entry
does not notice that, it will free spt again in its error
path.
Fix this by canceling the mapping of DMA address and freeing sub_spt.
Besides, leave the handle of spt destroy to caller function instead
of callee function when error occurs.
Fixes: b901b25 ("drm/i915/gvt: Add 2M huge gtt support")
Signed-off-by: Zheng Wang <[email protected]>
Reviewed-by: Zhenyu Wang <[email protected]>
Signed-off-by: Zhenyu Wang <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]1 parent a06d4b9 commit 4a61648
1 file changed
+13
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1209 | 1209 | | |
1210 | 1210 | | |
1211 | 1211 | | |
1212 | | - | |
1213 | | - | |
1214 | | - | |
1215 | | - | |
| 1212 | + | |
| 1213 | + | |
1216 | 1214 | | |
1217 | 1215 | | |
1218 | 1216 | | |
| |||
1231 | 1229 | | |
1232 | 1230 | | |
1233 | 1231 | | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
| 1239 | + | |
| 1240 | + | |
| 1241 | + | |
| 1242 | + | |
1234 | 1243 | | |
1235 | 1244 | | |
1236 | 1245 | | |
| |||
0 commit comments