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: media: nvidia: tegra-vde: Fix iommu_map_sgtable() return value check
Date: Thu, 23 Apr 2026 08:57:24 +1000	[thread overview]
Message-ID: <review-patch4-20260421-iommu_map_sgtable-return-v1-4-fb484c07d2a1@nvidia.com> (raw)
In-Reply-To: <20260421-iommu_map_sgtable-return-v1-4-fb484c07d2a1@nvidia.com>

Patch Review

**Status: Good**

Same pattern as patch 1: introduces `ssize_t map_err`, checks `< 0`, propagates the real error instead of hardcoded `-ENXIO`:

```c
+	ssize_t map_err;
...
+	map_err = iommu_map_sgtable(vde->domain, addr, sgt,
+				    IOMMU_READ | IOMMU_WRITE);
+	if (map_err < 0) {
 		__free_iova(&vde->iova, iova);
-		return -ENXIO;
+		return map_err;
```

The function returns `int`, and `return map_err` narrows `ssize_t` to `int` -- safe on the error path.

Note that the old code reused `size` for both the input size parameter and the `iommu_map_sgtable` return. The new code avoids that reuse by using a separate `map_err` variable, which is cleaner since `size` continues to be needed later (it's used as a parameter on line 22 and for iova allocation on line 31).

No issues.

---
Generated by Claude Code Patch Reviewer

  reply	other threads:[~2026-04-22 22:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-21  4:02 [PATCH 0/4] Fix checking of iommu_map_sgtable return value Mikko Perttunen
2026-04-21  4:02 ` [PATCH 1/4] gpu: host1x: Fix iommu_map_sgtable() return value check Mikko Perttunen
2026-04-22 22:57   ` Claude review: " Claude Code Review Bot
2026-04-21  4:02 ` [PATCH 2/4] drm/tegra: " Mikko Perttunen
2026-04-22 22:57   ` Claude review: " Claude Code Review Bot
2026-04-21  4:02 ` [PATCH 3/4] drm/msm: Fix iommu_map_sgtable() return value check and avoid WARN Mikko Perttunen
2026-04-22 22:57   ` Claude review: " Claude Code Review Bot
2026-04-21  4:02 ` [PATCH 4/4] media: nvidia: tegra-vde: Fix iommu_map_sgtable() return value check Mikko Perttunen
2026-04-22 22:57   ` Claude Code Review Bot [this message]
2026-04-22 22:57 ` Claude review: Fix checking of iommu_map_sgtable return value 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-20260421-iommu_map_sgtable-return-v1-4-fb484c07d2a1@nvidia.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