Commit 8a53e29
drm/imagination: Fix error path in pvr_vm_create_context
It is possible to double free the vm_ctx->mmu_ctx object in this
function.
630 err_page_table_destroy:
--> 631 pvr_mmu_context_destroy(vm_ctx->mmu_ctx);
The pvr_vm_context_put() function does:
kref_put(&vm_ctx->ref_count, pvr_vm_context_release);
Here the pvr_vm_context_release() will call:
pvr_mmu_context_destroy(vm_ctx->mmu_ctx);
Refactor to an unwind style.
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Donald Robson <donald.robson@imgtec.com>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Maxime Ripard <mripard@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20231213144431.94956-2-donald.robson@imgtec.com1 parent f175498 commit 8a53e29
1 file changed
Lines changed: 13 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
556 | 556 | | |
557 | 557 | | |
558 | 558 | | |
559 | | - | |
560 | | - | |
561 | 559 | | |
562 | | - | |
563 | | - | |
564 | | - | |
565 | | - | |
566 | | - | |
567 | | - | |
568 | | - | |
569 | 560 | | |
570 | 561 | | |
571 | 562 | | |
572 | | - | |
573 | | - | |
574 | | - | |
575 | | - | |
| 563 | + | |
| 564 | + | |
576 | 565 | | |
577 | 566 | | |
578 | 567 | | |
| |||
583 | 572 | | |
584 | 573 | | |
585 | 574 | | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
586 | 584 | | |
587 | 585 | | |
588 | 586 | | |
589 | 587 | | |
590 | 588 | | |
591 | | - | |
592 | | - | |
| 589 | + | |
| 590 | + | |
593 | 591 | | |
594 | 592 | | |
595 | 593 | | |
| |||
0 commit comments