Home Home > GIT Browse > vanilla
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Brugger <mbrugger@suse.com>2017-11-24 13:51:29 +0100
committerMatthias Brugger <mbrugger@suse.com>2017-11-30 18:28:48 +0100
commitb48234dbc664b885167b7116bb21a23011156db4 (patch)
tree60334e19b02e9c7e5d85865daa8e388be4f336e3
parent7a4ba5e077420bec44ae45422c8b88ff8858a03d (diff)
net: hns: set correct return value (bsc#1068693).
-rw-r--r--patches.drivers/net-hns-set-correct-return-value.patch39
-rw-r--r--series.conf1
2 files changed, 40 insertions, 0 deletions
diff --git a/patches.drivers/net-hns-set-correct-return-value.patch b/patches.drivers/net-hns-set-correct-return-value.patch
new file mode 100644
index 0000000000..85a16af0af
--- /dev/null
+++ b/patches.drivers/net-hns-set-correct-return-value.patch
@@ -0,0 +1,39 @@
+From: Pan Bian <bianpan2016@163.com>
+Date: Mon, 30 Oct 2017 16:50:01 +0800
+Subject: net: hns: set correct return value
+Git-commit: d2083d0e92117598dd24ba270af12376f1fb8866
+Patch-mainline: v4.14-rc8
+References: bsc#1068693
+
+The function of_parse_phandle() returns a NULL pointer if it cannot
+resolve a phandle property to a device_node pointer. In function
+hns_nic_dev_probe(), its return value is passed to PTR_ERR to extract
+the error code. However, in this case, the extracted error code will
+always be zero, which is unexpected.
+
+Signed-off-by: Pan Bian <bianpan2016@163.com>
+Reviewed-by: Tobias Klauser <tklauser@distanz.ch>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Matthias Brugger <mbrugger@suse.com>
+---
+ drivers/net/ethernet/hisilicon/hns/hns_enet.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/ethernet/hisilicon/hns/hns_enet.c b/drivers/net/ethernet/hisilicon/hns/hns_enet.c
+index 36520634c96a..e77192683dba 100644
+--- a/drivers/net/ethernet/hisilicon/hns/hns_enet.c
++++ b/drivers/net/ethernet/hisilicon/hns/hns_enet.c
+@@ -2369,8 +2369,8 @@ static int hns_nic_dev_probe(struct platform_device *pdev)
+ priv->enet_ver = AE_VERSION_2;
+
+ ae_node = of_parse_phandle(dev->of_node, "ae-handle", 0);
+- if (IS_ERR_OR_NULL(ae_node)) {
+- ret = PTR_ERR(ae_node);
++ if (!ae_node) {
++ ret = -ENODEV;
+ dev_err(dev, "not find ae-handle\n");
+ goto out_read_prop_fail;
+ }
+--
+2.14.2
+
diff --git a/series.conf b/series.conf
index 43ff76c7f9..c3ce5fdbe8 100644
--- a/series.conf
+++ b/series.conf
@@ -5226,6 +5226,7 @@
patches.drivers/nvme-rdma-fix-possible-hang-when-issuing-commands-du.patch
patches.drivers/nvme-Fix-setting-logical-block-format-when-revalidat.patch
patches.drivers/net-mlx5e-core-en_fs-fix-pointer-dereference-after-f.patch
+ patches.drivers/net-hns-set-correct-return-value.patch
patches.drivers/net-usb-asix-fill-null-ptr-deref-in-asix_suspend.patch
patches.drivers/net-mlx5-Loop-over-temp-list-to-release-delay-events.patch
patches.drivers/net-mlx5-Cancel-health-poll-before-sending-panic-tea.patch