Home Home > GIT Browse > SLE15-AZURE
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2019-02-14 12:11:16 +0100
committerTakashi Iwai <tiwai@suse.de>2019-02-14 12:11:17 +0100
commit6c76a72a3cd2a38a2a957db370ad25a7db48f6e5 (patch)
tree1638bc034df0eca51ab14e6fcd3566bae9f102e5
parentb28552c488d512f1d6f94bd89fc67531d699b574 (diff)
ptp: check gettime64 return code in PTP_SYS_OFFSET ioctl
(bsc#1051510). suse-commit: 89ee792cf44efbe0f25ae37fd5fba539c315f650
-rw-r--r--drivers/ptp/ptp_chardev.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/ptp/ptp_chardev.c b/drivers/ptp/ptp_chardev.c
index a421d6c551b6..ecb41eacd74b 100644
--- a/drivers/ptp/ptp_chardev.c
+++ b/drivers/ptp/ptp_chardev.c
@@ -228,7 +228,9 @@ long ptp_ioctl(struct posix_clock *pc, unsigned int cmd, unsigned long arg)
pct->sec = ts.tv_sec;
pct->nsec = ts.tv_nsec;
pct++;
- ptp->info->gettime64(ptp->info, &ts);
+ err = ptp->info->gettime64(ptp->info, &ts);
+ if (err)
+ goto out;
pct->sec = ts.tv_sec;
pct->nsec = ts.tv_nsec;
pct++;
@@ -281,6 +283,7 @@ long ptp_ioctl(struct posix_clock *pc, unsigned int cmd, unsigned long arg)
break;
}
+out:
kfree(sysoff);
return err;
}