Commit 78607ea4 authored by Federico Vaga's avatar Federico Vaga

kernel:bugfix: clean up chrdev region correctly

The bug can be exposed by doing several time insmod/rmmod.

On removal we are not releasing the entire region that we allocated.
So, after a some dozen of insmod/rmmod, we run out of chrdev space.
Signed-off-by: Federico Vaga's avatarFederico Vaga <federico.vaga@cern.ch>
parent 612f65ed
......@@ -863,9 +863,10 @@ out_all:
static void trtl_exit(void)
{
fmc_driver_unregister(&trtl_dev_drv);
cdev_del(&cdev_hmq);
cdev_del(&cdev_cpu);
unregister_chrdev_region(basedev,
TRTL_MAX_CPU_MINORS + TRTL_MAX_HMQ_MINORS);
cdev_del(&cdev_dev);
unregister_chrdev_region(basedev, TRTL_MAX_MINORS);
class_unregister(&trtl_cdev_class);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment