In the Linux kernel before 4.7, the amd_gpio_remove function in drivers/pinctrl/pinctrl-amd.c calls the pinctrl_unregister function, leading to a double free.
https://usn.ubuntu.com/3848-2/
https://usn.ubuntu.com/3848-1/
https://github.com/torvalds/linux/commit/8dca4a41f1ad65043a78c2338d9725f859c8d2c3
https://github.com/torvalds/linux/commit/251e22abde21833b3d29577e4d8c7aaccd650eee