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 <>
parent 612f65ed
...@@ -863,9 +863,10 @@ out_all: ...@@ -863,9 +863,10 @@ out_all:
static void trtl_exit(void) static void trtl_exit(void)
{ {
fmc_driver_unregister(&trtl_dev_drv); fmc_driver_unregister(&trtl_dev_drv);
cdev_del(&cdev_cpu); cdev_del(&cdev_cpu);
unregister_chrdev_region(basedev, cdev_del(&cdev_dev);
TRTL_MAX_CPU_MINORS + TRTL_MAX_HMQ_MINORS); unregister_chrdev_region(basedev, TRTL_MAX_MINORS);
class_unregister(&trtl_cdev_class); 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