From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/vmwgfx: Change ttm refs for dumb buffers.
Date: Sat, 16 May 2026 10:17:49 +1000 [thread overview]
Message-ID: <review-patch4-20260514224819.3631763-5-maaz.mombasawala@broadcom.com> (raw)
In-Reply-To: <20260514224819.3631763-5-maaz.mombasawala@broadcom.com>
Patch Review
**dma_buf leak fix is correct and important:**
```c
- if (dma_buf->ops != &tdev->ops)
- return -ENOSYS;
+ if (dma_buf->ops != &tdev->ops) {
+ ret = -ENOSYS;
+ goto out;
+ }
```
The original code returns `-ENOSYS` without calling `dma_buf_put(dma_buf)`, leaking the dma_buf reference acquired by `dma_buf_get(fd)`. The fix is straightforward and correct.
**Dumb buffer TTM ref preservation:**
```c
- ttm_ref_object_base_unref(tfile, arg.rep.handle);
+ if (ret)
+ ttm_ref_object_base_unref(tfile, arg.rep.handle);
```
Previously, the TTM base object reference was unconditionally dropped after dumb buffer creation. This patch preserves it on the success path. The commit message says this keeps the dumb buffer valid for framebuffer usage. This makes sense if the TTM object reference was the only thing preventing the surface from being destroyed while still in use. However, this changes the cleanup responsibility — whoever destroys the dumb buffer must now handle this reference. The `refcount_release = NULL` set just above (`usurf->prime.base.refcount_release = NULL`) disables the normal TTM release callback, so the GEM object destruction path must handle this. This interaction should be documented or verified to avoid future leaks.
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-05-16 0:17 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-14 22:48 [PATCH v3 0/5] Fix some issues from igt runs Maaz Mombasawala
2026-05-14 22:48 ` [PATCH v3 1/5] drm/vmwgfx: Add some checks to vmw_cursor_plane_atomic_update Maaz Mombasawala
2026-05-16 0:17 ` Claude review: " Claude Code Review Bot
2026-05-14 22:48 ` [PATCH v3 2/5] drm/vmwgfx: Check vrefresh in drm_mode_setcrtc Maaz Mombasawala
2026-05-16 0:17 ` Claude review: " Claude Code Review Bot
2026-05-14 22:48 ` [PATCH v3 3/5] drm/vmwgfx: Reserve ttm object before resv usage Maaz Mombasawala
2026-05-16 0:17 ` Claude review: " Claude Code Review Bot
2026-05-14 22:48 ` [PATCH v3 4/5] drm/vmwgfx: Change ttm refs for dumb buffers Maaz Mombasawala
2026-05-15 5:49 ` Zack Rusin
2026-05-16 0:17 ` Claude Code Review Bot [this message]
2026-05-14 22:48 ` [PATCH v3 5/5] drm/vmwgfx: Remove duplicates in vmwgfx_bo.h Maaz Mombasawala
2026-05-16 0:17 ` Claude review: " Claude Code Review Bot
2026-05-16 0:17 ` Claude review: Fix some issues from igt runs Claude Code Review Bot
-- strict thread matches above, loose matches on Subject: below --
2026-05-12 0:27 [PATCH v2 0/5] " Maaz Mombasawala
2026-05-12 0:27 ` [PATCH v2 4/5] drm/vmwgfx: Change ttm refs for dumb buffers Maaz Mombasawala
2026-05-16 4:26 ` Claude review: " Claude Code Review Bot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=review-patch4-20260514224819.3631763-5-maaz.mombasawala@broadcom.com \
--to=claude-review@example.com \
--cc=dri-devel-reviews@example.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox