On Thu, Oct 17, 2024 at 10:53:25AM +0000, Vimal Agrawal wrote:
misc_minor_alloc was allocating id using ida for minor only in case of MISC_DYNAMIC_MINOR but misc_minor_free was always freeing ids using ida_free causing a mismatch and following warn:
WARNING: CPU: 0 PID: 159 at lib/idr.c:525 ida_free+0x3e0/0x41f ida_free called for id=127 which is not allocated. <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
...
[<60941eb4>] ida_free+0x3e0/0x41f [<605ac993>] misc_minor_free+0x3e/0xbc [<605acb82>] misc_deregister+0x171/0x1b3
misc_minor_alloc is changed to allocate id from ida for all minors falling in the range of dynamic/ misc dynamic minors
Fixes: ab760791c0cf ("char: misc: Increase the maximum number of dynamic misc devices to 1048448") Signed-off-by: Vimal Agrawal vimal.agrawal@sophos.com Cc: stable@vger.kernel.org
v2: Added Fixes: added missed case for static minor in misc_minor_alloc v3: removed kunit changes as that will be added as second patch in this two patch series
drivers/char/misc.c | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-)
Did you mean to send this only to stable and yourself and not the maintainers involved here?
confused,
greg k-h