So, I wrote a basic char driver with IRQ_NO 1 for keyboard and registered a shared handler function for it. In this exit function I don't free the handler using free_irq(). In the dmesg logs I can see that the exit_function gets exectued successfully (when I do rmmod) but immediately after that the entire system freezes. With some other interrupt number (let's say 6) the system doesn't immediately freezes but eventually it does if I do cat /proc/interrupts/ or try to insert the driver again using insmod.
I know I should free the handler but I want to know where exactly the problem occurs if I don't free the handler.