phc2sys: Fix crash when trying to synchronize unadjustable clock.
A clock that cannot be adjusted has no servo. Check if a servo is present before updating the clock. Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>master
parent
8142da41b6
commit
3c7e4947e4
|
@ -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 */
|
||||
|
|
Loading…
Reference in New Issue