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: meson: Fix memory leak in error path in vdec Date: Thu, 04 Jun 2026 15:48:45 +1000 Message-ID: In-Reply-To: <20260530094326.11892-1-linux.amoon@gmail.com> References: <20260530094326.11892-1-linux.amoon@gmail.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: media: meson: Fix memory leak in error path in vdec Author: Anand Moon Patches: 9 Reviewed: 2026-06-04T15:48:45.580056 --- This is a v6 series of 8 patches fixing various bugs in the Amlogic Meson V= DEC staging driver, primarily addressing memory leaks, race conditions, and= NULL pointer dereferences reported by the Sashiko bot. The series touches = real bugs =E2=80=94 the original code has genuine lifetime, synchronization= , and error-handling issues. However, several patches have correctness prob= lems that introduce new bugs or are questionable in their approach. **Key concerns:** 1. **Patch 3** double-frees `sess->priv` =E2=80=94 `codec_ops->stop()` alre= ady frees it, then the error path does `kfree(sess->priv)` again. 2. **Patch 5** moves `codec_ops->drain()` before hardware teardown, which c= hanges behavior in a potentially unsafe way =E2=80=94 drain runs while hard= ware is still active but status is already set to `STATUS_STOPPED`. 3. **Patch 7** uses `READ_ONCE()` on `core->cur_sess` but the matching writ= es in patches 2/5 don't use `WRITE_ONCE()`, and the fix is insufficient for= the claimed race =E2=80=94 an IRQF_ONESHOT handler still accesses session = fields after the pointer check. 4. **Patch 1** has an error-path ordering issue =E2=80=94 `v4l2_fh_del()` i= s never called in the error unwind for `vdec_open()`. The series seems largely AI-generated (Sashiko bot reports, cover letter to= ne), and while the problems identified are real, the fixes need more carefu= l thought about ordering, locking, and double-free hazards. --- --- Generated by Claude Code Patch Reviewer