On Sat, May 16, 2026 at 10:30:13PM +0800, Tzung-Bi Shih wrote:
> This series addresses a potential Use-After-Free error when a device is
> deregistered while file operations are still in progress or files remain
> open in cros_ec_chardev.
>
> - Patches 1 to 3 are preparation steps in cros_ec_chardev driver. They
> introduce reference counting for platform driver data and an event
> relayer. This removes the direct access to `ec_dev->event_notifier`
> in `cros_ec_chardev_release()`.
> - Patch 4 introduces a rwsem for protecting `ec_dev` to prevent the UAF
> error.
Other than my fairly minor remarks on the last patch this whole thing
looks good to me
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Jason