public inbox for drm-ai-reviews@public-inbox.freedesktop.org
 help / color / mirror / Atom feed
From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/vmwgfx: Don't overwrite KMS surface dirty tracker
Date: Tue, 03 Mar 2026 12:53:48 +1000	[thread overview]
Message-ID: <review-patch1-20260302200330.66763-1-ian.forbes@broadcom.com> (raw)
In-Reply-To: <20260302200330.66763-1-ian.forbes@broadcom.com>

Patch Review

**Correctness: Good.** The fix is sound. Looking at `vmw_surface_dirty_alloc()` at `vmwgfx_surface.c:2040`:

```c
res->dirty = (struct vmw_resource_dirty *) dirty;
```

This unconditionally overwrites `res->dirty`, so if a dirty tracker was already allocated, the previous allocation is leaked. The guard:

```c
if (surface->res.dirty == NULL)
    ret = surface->res.func->dirty_alloc(&surface->res);
```

correctly prevents the double allocation. This pattern is consistent with the other call site in `vmwgfx_resource.c:402` which also checks `!res->dirty` before calling `dirty_alloc`.

**One minor observation:** The existing code at line 772 already checks `surface->res.func->dirty_alloc` (that the function pointer is non-NULL) before entering the block. It might be slightly cleaner to also set `surface->res.coherent = true` only when the dirty tracker is actually being newly allocated (i.e., move it inside the `if (surface->res.dirty == NULL)` block), since if `dirty` is already allocated, coherent should presumably already be true. However, setting `coherent = true` redundantly is harmless — it's just a boolean assignment — so this is a style nit rather than a bug.

**Commit message and tags: Good.** Has `Reported-by`, `Closes` with lore link, `Fixes` tag referencing the commit that introduced the regression, and proper `Signed-off-by`. All in order.

**Verdict:** The patch is a clean, minimal fix for the reported memory leak. It looks good to merge.

---
Generated by Claude Code Patch Reviewer

      parent reply	other threads:[~2026-03-03  2:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-02 20:03 [PATCH] drm/vmwgfx: Don't overwrite KMS surface dirty tracker Ian Forbes
2026-03-03  2:53 ` Claude review: " Claude Code Review Bot
2026-03-03  2:53 ` Claude Code Review Bot [this message]

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-patch1-20260302200330.66763-1-ian.forbes@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