This will make sure we get an appropriate error message in case of memory allocation error, and not just a "Segmentation Fault" Added some validation on xzalloc return in serial_tty_new to properly deallocate resources when an error occurs.