Re: [PATCH] binderfs: free minor on binder-control creation failure
From: Alice Ryhl
Date: Sat Aug 08 2026 - 09:35:45 EST
On Thu, Aug 06, 2026 at 07:23:38PM +0800, Chao Huang wrote:
> From: Chao Huang <huangchao@xxxxxxxxxx>
>
> binderfs_binder_ctl_create() allocates a minor before creating the
> binder-control dentry. If d_alloc_name() fails, the error path frees the
> device and drops the inode, but leaves the minor allocated in
> binderfs_minors. Repeated failures can therefore exhaust the global minor
> IDA.
>
> Initialize minor to an invalid value and release it from the common error
> path after a successful allocation.
>
> Signed-off-by: Chao Huang <huangchao@xxxxxxxxxx>
Thanks!
Please fix drivers/android/binder/rust_binderfs.c as well.
Alice