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:19 +0100
commit29f949ffac4d9651be11e6afc7057caf8b1d02ad (patch)
tree5d7cc9c5b429df6915f955aec9fdd0f1cd4dee39
parent6c76a72a3cd2a38a2a957db370ad25a7db48f6e5 (diff)
ptp: Fix pass zero to ERR_PTR() in ptp_clock_register
(bsc#1051510). suse-commit: da8955a8cfbac7de855124f12ce06b14f93e7146
-rw-r--r--drivers/ptp/ptp_clock.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/ptp/ptp_clock.c b/drivers/ptp/ptp_clock.c
index b77435783ef3..c5ed51e441e2 100644
--- a/drivers/ptp/ptp_clock.c
+++ b/drivers/ptp/ptp_clock.c
@@ -225,8 +225,10 @@ struct ptp_clock *ptp_clock_register(struct ptp_clock_info *info,
ptp->dev = device_create_with_groups(ptp_class, parent, ptp->devid,
ptp, ptp->pin_attr_groups,
"ptp%d", ptp->index);
- if (IS_ERR(ptp->dev))
+ if (IS_ERR(ptp->dev)) {
+ err = PTR_ERR(ptp->dev);
goto no_device;
+ }
/* Register a new PPS source. */
if (info->pps) {
@@ -237,6 +239,7 @@ struct ptp_clock *ptp_clock_register(struct ptp_clock_info *info,
pps.owner = info->owner;
ptp->pps_source = pps_register_source(&pps, PTP_PPS_DEFAULTS);
if (!ptp->pps_source) {
+ err = -EINVAL;
pr_err("failed to register pps source\n");
goto no_pps;
}