aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic/backport-5.15/787-v5.12-r8152-check-if-the-pointer-of-the-function-exists.patch
diff options
context:
space:
mode:
authorAnsuel Smith <ansuelsmth@gmail.com>2021-11-04 21:52:43 +0100
committerDaniel Golle <daniel@makrotopia.org>2022-03-27 00:07:34 +0000
commit9a038e7fd12eae3695875232962f96af8252f3ba (patch)
tree3ac43d08d68ead1856e271791f5f5ba75f555e95 /target/linux/generic/backport-5.15/787-v5.12-r8152-check-if-the-pointer-of-the-function-exists.patch
parent13960fb0e0babcd99530fcb234073af0c0a5e2f5 (diff)
downloadupstream-9a038e7fd12eae3695875232962f96af8252f3ba.tar.gz
upstream-9a038e7fd12eae3695875232962f96af8252f3ba.tar.bz2
upstream-9a038e7fd12eae3695875232962f96af8252f3ba.zip
generic: 5.15: copy config and patch from 5.10
Copy config and patches from kernel 5.10 to kernel 5.15 Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
Diffstat (limited to 'target/linux/generic/backport-5.15/787-v5.12-r8152-check-if-the-pointer-of-the-function-exists.patch')
-rw-r--r--target/linux/generic/backport-5.15/787-v5.12-r8152-check-if-the-pointer-of-the-function-exists.patch51
1 files changed, 51 insertions, 0 deletions
diff --git a/target/linux/generic/backport-5.15/787-v5.12-r8152-check-if-the-pointer-of-the-function-exists.patch b/target/linux/generic/backport-5.15/787-v5.12-r8152-check-if-the-pointer-of-the-function-exists.patch
new file mode 100644
index 0000000000..5bc4e2b0a1
--- /dev/null
+++ b/target/linux/generic/backport-5.15/787-v5.12-r8152-check-if-the-pointer-of-the-function-exists.patch
@@ -0,0 +1,51 @@
+From e78b75f5be204a0a235da995d01c778dc282bb42 Mon Sep 17 00:00:00 2001
+From: Hayes Wang <hayeswang@realtek.com>
+Date: Fri, 19 Feb 2021 17:04:41 +0800
+Subject: [PATCH] r8152: check if the pointer of the function exists
+
+commit c79515e47935c747282c6ed2ee5b2ef039756eeb upstream.
+
+Return error code if autosuspend_en, eee_get, or eee_set don't exist.
+
+Signed-off-by: Hayes Wang <hayeswang@realtek.com>
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+---
+ drivers/net/usb/r8152.c | 13 +++++++++++++
+ 1 file changed, 13 insertions(+)
+
+--- a/drivers/net/usb/r8152.c
++++ b/drivers/net/usb/r8152.c
+@@ -5758,6 +5758,9 @@ static int rtl8152_runtime_suspend(struc
+ struct net_device *netdev = tp->netdev;
+ int ret = 0;
+
++ if (!tp->rtl_ops.autosuspend_en)
++ return -EBUSY;
++
+ set_bit(SELECTIVE_SUSPEND, &tp->flags);
+ smp_mb__after_atomic();
+
+@@ -6157,6 +6160,11 @@ rtl_ethtool_get_eee(struct net_device *n
+ struct r8152 *tp = netdev_priv(net);
+ int ret;
+
++ if (!tp->rtl_ops.eee_get) {
++ ret = -EOPNOTSUPP;
++ goto out;
++ }
++
+ ret = usb_autopm_get_interface(tp->intf);
+ if (ret < 0)
+ goto out;
+@@ -6179,6 +6187,11 @@ rtl_ethtool_set_eee(struct net_device *n
+ struct r8152 *tp = netdev_priv(net);
+ int ret;
+
++ if (!tp->rtl_ops.eee_set) {
++ ret = -EOPNOTSUPP;
++ goto out;
++ }
++
+ ret = usb_autopm_get_interface(tp->intf);
+ if (ret < 0)
+ goto out;