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: lib: add dmabuf token infrastructure
Date: Tue, 05 May 2026 11:26:00 +1000	[thread overview]
Message-ID: <review-patch5-c61e6d928f86f4cb253ae350272e6039faefd3a6.1777475843.git.asml.silence@gmail.com> (raw)
In-Reply-To: <c61e6d928f86f4cb253ae350272e6039faefd3a6.1777475843.git.asml.silence@gmail.com>

Patch Review

The core of the series. The token/map separation is well-motivated for supporting invalidation. The percpu refcount + dma fence pattern for tracking in-flight I/O is correct.

**Bug: Missing cleanup after failed `WARN_ON_ONCE` in `io_dmabuf_token_create`**

```c
ret = file->f_op->create_dmabuf_token(file, token);
if (ret) {
    memset(token, 0, sizeof(*token));
    dma_buf_put(dmabuf);
    return ret;
}

if (WARN_ON_ONCE(!token->dev_ops ||
         !token->dev_ops->map ||
         !token->dev_ops->unmap ||
         !token->dev_ops->release))
    return -EINVAL;
```

If the WARN fires, the function returns `-EINVAL` without calling `dma_buf_put(dmabuf)` or cleaning up whatever `create_dmabuf_token` allocated (via `dev_ops->release`). The dmabuf ref from `get_dma_buf()` earlier is leaked. The token struct may also be partially initialized.

**SPDX identifier:** `lib/io_dmabuf_token.c` uses `/* SPDX-License-Identifier: GPL-2.0 */` (C-style comment) which is for header files. Source files should use `// SPDX-License-Identifier: GPL-2.0`.

**Nit:** The header guard is `_LINUX_DMA_TOKEN_H` but the file is `io_dmabuf_token.h` — the guard could be `_LINUX_IO_DMABUF_TOKEN_H` for consistency.

---

---
Generated by Claude Code Patch Reviewer

  reply	other threads:[~2026-05-05  1:26 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-29 15:25 [PATCH v3 00/10] Add dmabuf read/write via io_uring Pavel Begunkov
2026-04-29 15:25 ` [PATCH v3 01/10] file: add callback for creating long-term dmabuf maps Pavel Begunkov
2026-04-30  6:03   ` Christian König
2026-04-30 18:33     ` Pavel Begunkov
2026-05-04  7:14       ` Christian König
2026-05-05  1:25   ` Claude review: " Claude Code Review Bot
2026-04-29 15:25 ` [PATCH v3 02/10] iov_iter: add iterator type for " Pavel Begunkov
2026-05-05  1:26   ` Claude review: " Claude Code Review Bot
2026-04-29 15:25 ` [PATCH v3 03/10] block: move bvec init into __bio_clone Pavel Begunkov
2026-05-05  1:26   ` Claude review: " Claude Code Review Bot
2026-04-29 15:25 ` [PATCH v3 04/10] block: introduce dma map backed bio type Pavel Begunkov
2026-05-05  1:26   ` Claude review: " Claude Code Review Bot
2026-04-29 15:25 ` [PATCH v3 05/10] lib: add dmabuf token infrastructure Pavel Begunkov
2026-05-05  1:26   ` Claude Code Review Bot [this message]
2026-04-29 15:25 ` [PATCH v3 06/10] block: forward create_dmabuf_token to drivers Pavel Begunkov
2026-05-05  1:26   ` Claude review: " Claude Code Review Bot
2026-04-29 15:25 ` [PATCH v3 07/10] nvme-pci: implement dma_token backed requests Pavel Begunkov
2026-04-29 15:29   ` Pavel Begunkov
2026-04-29 16:07   ` Maurizio Lombardi
2026-04-30 18:18     ` Pavel Begunkov
2026-05-05  1:26   ` Claude review: " Claude Code Review Bot
2026-04-29 15:25 ` [PATCH v3 08/10] io_uring/rsrc: introduce buf registration structure Pavel Begunkov
2026-05-05  1:26   ` Claude review: " Claude Code Review Bot
2026-04-29 15:25 ` [PATCH v3 09/10] io_uring/rsrc: extend buffer update Pavel Begunkov
2026-05-05  1:26   ` Claude review: " Claude Code Review Bot
2026-04-29 15:25 ` [PATCH v3 10/10] io_uring/rsrc: add dmabuf backed registered buffers Pavel Begunkov
2026-05-05  1:26   ` Claude review: " Claude Code Review Bot
2026-05-05  1:25 ` Claude review: Add dmabuf read/write via io_uring 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-patch5-c61e6d928f86f4cb253ae350272e6039faefd3a6.1777475843.git.asml.silence@gmail.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