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: fix order of trace and fput Date: Sun, 12 Apr 2026 12:31:04 +1000 Message-ID: In-Reply-To: <20260408122437.1364-1-christian.koenig@amd.com> References: <20260408122437.1364-1-christian.koenig@amd.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Overall Series Review Subject: dma-buf: fix order of trace and fput Author: "=3D?UTF-8?q?Christian=3D20K=3DC3=3DB6nig?=3D" Patches: 2 Reviewed: 2026-04-12T12:31:04.964930 --- This is a single-patch fix for a use-after-free bug in `dma_buf_put()`. The= bug is real and the fix is correct: after `fput(dmabuf->file)` drops the l= ast reference, the dma-buf may be freed, yet the current code proceeds to c= all `DMA_BUF_TRACE(trace_dma_buf_put, dmabuf)` which accesses `dmabuf->name= _lock`, `dmabuf->exp_name`, `dmabuf->size`, and `dmabuf->file->f_inode->i_i= no` =E2=80=94 all potentially freed memory. The fix simply reorders the two operations so the tracepoint fires before `= fput()`. This is the obvious and correct approach. There is one tag issue that should be fixed before merging. --- Generated by Claude Code Patch Reviewer