Syzkaller reports memory leak issue at gsmld_attach_gsm() in 5.10 stable releases. The reproducer injects the memory allocation errors to tty_register_device(); as a result, tty_kref_get() isn't called after this error, which leads to tty_struct leak. The issue has been fixed by the following patches that can be cleanly applied to the 5.10 branch. Found by InfoTeCS on behalf of Linux Verification Center (linuxtesting.org) with Syzkaller