From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot 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 Message-ID: In-Reply-To: <20260421-iommu_map_sgtable-return-v1-4-fb484c07d2a1@nvidia.com> References: <20260421-iommu_map_sgtable-return-v1-0-fb484c07d2a1@nvidia.com> <20260421-iommu_map_sgtable-return-v1-4-fb484c07d2a1@nvidia.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 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