From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: dma-buf: Route SGT related actions through attach->map_type Date: Wed, 18 Feb 2026 11:37:57 +1000 Message-ID: In-Reply-To: <4-v1-b5cab63049c0+191af-dmabuf_map_type_jgg@nvidia.com> References: <0-v1-b5cab63049c0+191af-dmabuf_map_type_jgg@nvidia.com> <4-v1-b5cab63049c0+191af-dmabuf_map_type_jgg@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 > + const struct dma_buf_mapping_sgt_exp_ops *sgt_exp_ops = > + dma_buf_get_sgt_ops(attach); > struct sg_table *sg_table; > signed long ret; > > might_sleep(); > > - if (WARN_ON(!attach || !attach->dmabuf)) > + if (WARN_ON(!attach || !attach->dmabuf || !sgt_exp_ops)) `dma_buf_get_sgt_ops(attach)` dereferences `attach->map_type.type` before the `WARN_ON(!attach)` check. If `attach` were NULL, this would crash before reaching the WARN_ON. The same pattern exists in `dma_buf_unmap_attachment`. Practically, no caller ever passes NULL here, but the ordering is technically wrong -- the ops lookup should come after the NULL checks. The debugfs changes look good. --- Generated by Claude Code Patch Reviewer