From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: dma-buf: heaps: coherent: Turn heap into a module Date: Mon, 09 Mar 2026 09:02:40 +1000 Message-ID: In-Reply-To: <20260306-b4-dmabuf-heap-coherent-rmem-v3-6-3d00d36c9bc4@redhat.com> References: <20260306-b4-dmabuf-heap-coherent-rmem-v3-0-3d00d36c9bc4@redhat.com> <20260306-b4-dmabuf-heap-coherent-rmem-v3-6-3d00d36c9bc4@redhat.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Patch Review Straightforward change from `bool` to `tristate` and adding `MODULE_LICENSE= `/`MODULE_IMPORT_NS`. **Issue: Missing `MODULE_LICENSE` should have been in patch 5** Patch 5 adds `MODULE_DESCRIPTION` but not `MODULE_LICENSE("GPL")`. Even for= built-in code, it's good practice. More importantly, this means patch 5 do= esn't compile as a module (the Kconfig is `bool` in patch 5, so it's techni= cally fine, but it's cleaner to include the license from the start). **No `module_exit`**: As noted above, this will warn when built as a module= . The CMA heap series presumably addresses this the same way, but it should= be explicitly noted or suppressed. --- ### Summary of key issues: 1. **Bug (patch 2)**: Double `put_device()` in `dma_heap_register()` error = path + `dma_heap_add()` error path causes UAF 2. **Bug (patch 2)**: `dma_heap_dev_release()` does `kfree(heap->name)` but= `dma_heap_create()` doesn't `kstrdup()` the name =E2=80=94 existing caller= s pass string literals 3. **Bug (patch 2 + 5)**: `err3` path in `dma_heap_register()` does `device= _destroy()` + `dma_heap_destroy()` =E2=80=94 double put/free 4. **Bug (patch 5)**: Double-free of `coh_heap->name` in `__coherent_heap_r= egister()` error path 5. **Concern (patch 5)**: `virt_to_page()` on `dma_alloc_coherent()` return= is unsafe on architectures with `no-map` coherent regions 6. **Minor (patch 5)**: Unnecessary cache sync ops for coherent memory, swa= llowed error code in `map_dma_buf`, missing `\n` in `pr_warn` --- Generated by Claude Code Patch Reviewer