A clock that cannot be adjusted has no servo. Check if a servo is
present before updating the clock.

Signed-off-by: Miroslav Lichvar <mlich...@redhat.com>
---
 phc2sys.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/phc2sys.c b/phc2sys.c
index b8f1ea0..a476e63 100644
--- a/phc2sys.c
+++ b/phc2sys.c
@@ -782,6 +782,11 @@ static int do_loop(struct node *node, int subscriptions)
                            !strcmp(clock->device, node->master->device))
                                continue;
 
+                       if (!clock->servo) {
+                               pr_err("cannot update clock without servo");
+                               return -1;
+                       }
+
                        if (clock->clkid == CLOCK_REALTIME &&
                            node->master->sysoff_method >= 0) {
                                /* use sysoff */
-- 
2.17.2



_______________________________________________
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Reply via email to