Commit 4c29bac
drm/i915/gvt: fix double free bug in split_2MB_gtt_entry
[ Upstream commit 4a61648 ]
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]
Signed-off-by: Sasha Levin <[email protected]>1 parent 5866a6d commit 4c29bac
1 file changed
+13
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1214 | 1214 | | |
1215 | 1215 | | |
1216 | 1216 | | |
1217 | | - | |
1218 | | - | |
1219 | | - | |
1220 | | - | |
| 1217 | + | |
| 1218 | + | |
1221 | 1219 | | |
1222 | 1220 | | |
1223 | 1221 | | |
| |||
1236 | 1234 | | |
1237 | 1235 | | |
1238 | 1236 | | |
| 1237 | + | |
| 1238 | + | |
| 1239 | + | |
| 1240 | + | |
| 1241 | + | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
1239 | 1248 | | |
1240 | 1249 | | |
1241 | 1250 | | |
| |||
0 commit comments