Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

s390/3270: fix missing device_destroy() call

Unloading the fs3270 kernel module does not remove the created
"3270/tub" device. Reloading the module then causes a sysfs warning:
"sysfs: cannot create duplicate filename '/devices/virtual/3270/3270!tub'".

Call device_destroy() in the module exit function to solve this issue.

Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>

authored by

Hendrik Brueckner and committed by
Martin Schwidefsky
d1e61fe4 aec644e5

+1
+1
drivers/s390/char/fs3270.c
··· 564 564 fs3270_exit(void) 565 565 { 566 566 raw3270_unregister_notifier(&fs3270_notifier); 567 + device_destroy(class3270, MKDEV(IBM_FS3270_MAJOR, 0)); 567 568 __unregister_chrdev(IBM_FS3270_MAJOR, 0, 1, "fs3270"); 568 569 } 569 570