serial: core: fix transmit-buffer reset and memleak
This is an automated ID intended to aid in discovery of potential security vulnerabilities. The actual impact and attack plausibility have not yet been proven. This ID is fixed in Linux Kernel version v5.4.164 by commit c5da8aa441053958594f94254592bb41264bdfbf, it was introduced in version v4.9 by commit 761ed4a94582ab291aa24dcbea4e01e8936488c8. For more details please see the references link.