[PATCH 5.0 090/146] serial: max310x: Fix to avoid potential NULL pointer dereference