From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: gpu: host1x: Fix device reference leak in device_add() error path Date: Mon, 13 Apr 2026 19:10:39 +1000 Message-ID: In-Reply-To: <20260412121836.2461556-1-lgs201920130244@gmail.com> References: <20260412121836.2461556-1-lgs201920130244@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: gpu: host1x: Fix device reference leak in device_add() error path Author: Guangshuo Li Patches: 1 Reviewed: 2026-04-13T19:10:39.741073 --- This is a single-patch fix targeting a device reference leak in the `host1x= _device_add()` error path when `device_add()` fails for a device with no su= bdevices. The identified bug is real: the original code logs the error but = falls through to `return 0`, leaking the device reference and leaving a hal= f-initialized device on `host1x->devices`. However, **the proposed fix introduces a new bug** =E2=80=94 a double list = removal that will crash or warn on most kernel configurations. The `list_de= l()` call poisons the list pointers, and then `put_device()` triggers the r= elease callback (`host1x_device_release` =E2=86=92 `__host1x_device_del`) w= hich calls `list_del_init()` on those same poisoned pointers. On kernels wi= thout `CONFIG_DEBUG_LIST` / `CONFIG_LIST_HARDENED` (i.e., most production k= ernels), this dereferences `LIST_POISON1`/`LIST_POISON2` and causes a kerne= l oops. **Recommendation: Needs revision (NAK as-is).** --- --- Generated by Claude Code Patch Reviewer