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
commitda8955a8cfbac7de855124f12ce06b14f93e7146 (patch)
tree810788f61ec2199b7c301e4b7dac0cee59e56be6
parent89ee792cf44efbe0f25ae37fd5fba539c315f650 (diff)
ptp: Fix pass zero to ERR_PTR() in ptp_clock_register
(bsc#1051510).
-rw-r--r--patches.fixes/ptp-Fix-pass-zero-to-ERR_PTR-in-ptp_clock_register.patch53
-rw-r--r--series.conf1
2 files changed, 54 insertions, 0 deletions
diff --git a/patches.fixes/ptp-Fix-pass-zero-to-ERR_PTR-in-ptp_clock_register.patch b/patches.fixes/ptp-Fix-pass-zero-to-ERR_PTR-in-ptp_clock_register.patch
new file mode 100644
index 0000000000..47e2bd36f8
--- /dev/null
+++ b/patches.fixes/ptp-Fix-pass-zero-to-ERR_PTR-in-ptp_clock_register.patch
@@ -0,0 +1,53 @@
+From aea0a897af9e44c258e8ab9296fad417f1bc063a Mon Sep 17 00:00:00 2001
+From: YueHaibing <yuehaibing@huawei.com>
+Date: Fri, 23 Nov 2018 09:54:55 +0800
+Subject: [PATCH] ptp: Fix pass zero to ERR_PTR() in ptp_clock_register
+Git-commit: aea0a897af9e44c258e8ab9296fad417f1bc063a
+Patch-mainline: v5.0-rc1
+References: bsc#1051510
+
+Fix smatch warning:
+
+drivers/ptp/ptp_clock.c:298 ptp_clock_register() warn:
+ passing zero to 'ERR_PTR'
+
+'err' should be set while device_create_with_groups and
+pps_register_source fails
+
+Fixes: 85a66e550195 ("ptp: create "pins" together with the rest of attributes")
+Signed-off-by: YueHaibing <yuehaibing@huawei.com>
+Acked-by: Richard Cochran <richardcochran@gmail.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Acked-by: Takashi Iwai <tiwai@suse.de>
+
+---
+ drivers/ptp/ptp_clock.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/ptp/ptp_clock.c b/drivers/ptp/ptp_clock.c
+index 40fda23e4b05..8a81eecc0ecd 100644
+--- a/drivers/ptp/ptp_clock.c
++++ b/drivers/ptp/ptp_clock.c
+@@ -252,8 +252,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) {
+@@ -264,6 +266,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;
+ }
+--
+2.16.4
+
diff --git a/series.conf b/series.conf
index 965ec58806..32653d3da5 100644
--- a/series.conf
+++ b/series.conf
@@ -19982,6 +19982,7 @@
patches.fixes/e1000e-allow-non-monotonic-SYSTIM-readings.patch
patches.fixes/ptp-check-gettime64-return-code-in-PTP_SYS_OFFSET-io.patch
patches.drivers/usbnet-smsc95xx-fix-rx-packet-alignment.patch
+ patches.fixes/ptp-Fix-pass-zero-to-ERR_PTR-in-ptp_clock_register.patch
patches.drivers/can-flexcan-flexcan_irq-fix-indention.patch
patches.drivers/wlcore-Fix-the-return-value-in-case-of-error-in-wlco.patch
patches.drivers/rtl8xxxu-Fix-missing-break-in-switch.patch