[PATCH 4.14 080/107] serial: max310x: Fix to avoid potential NULL pointer dereference