Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2019-07-14 11:33:41 +0200
committerJiri Slaby <jslaby@suse.cz>2019-07-14 11:33:56 +0200
commit66931a310b466ed1063308d2e9a4ec732b752f5d (patch)
treea9ec28aab93daab19df44a759f1f8502ec497535
parent434a4b4f7f58bc237f1cc1c48ed14258fafaea68 (diff)
staging: fsl-dpaa2/ethsw: fix memory leak of switchdev_work
-rw-r--r--patches.kernel.org/5.2.1-055-staging-fsl-dpaa2-ethsw-fix-memory-leak-of-swit.patch37
-rw-r--r--series.conf1
2 files changed, 38 insertions, 0 deletions
diff --git a/patches.kernel.org/5.2.1-055-staging-fsl-dpaa2-ethsw-fix-memory-leak-of-swit.patch b/patches.kernel.org/5.2.1-055-staging-fsl-dpaa2-ethsw-fix-memory-leak-of-swit.patch
new file mode 100644
index 0000000000..103fdd0fb1
--- /dev/null
+++ b/patches.kernel.org/5.2.1-055-staging-fsl-dpaa2-ethsw-fix-memory-leak-of-swit.patch
@@ -0,0 +1,37 @@
+From: Colin Ian King <colin.king@canonical.com>
+Date: Sat, 8 Jun 2019 12:50:31 +0100
+Subject: [PATCH] staging: fsl-dpaa2/ethsw: fix memory leak of switchdev_work
+References: bnc#1012628
+Patch-mainline: 5.2.1
+Git-commit: 5555ebbbac822b4fa28db2be15aaf98b3c21af26
+
+commit 5555ebbbac822b4fa28db2be15aaf98b3c21af26 upstream.
+
+In the default event case switchdev_work is being leaked because
+nothing is queued for work. Fix this by kfree'ing switchdev_work
+before returning NOTIFY_DONE.
+
+Addresses-Coverity: ("Resource leak")
+Fixes: 44baaa43d7cc ("staging: fsl-dpaa2/ethsw: Add Freescale DPAA2 Ethernet Switch driver")
+Signed-off-by: Colin Ian King <colin.king@canonical.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+---
+ drivers/staging/fsl-dpaa2/ethsw/ethsw.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/drivers/staging/fsl-dpaa2/ethsw/ethsw.c b/drivers/staging/fsl-dpaa2/ethsw/ethsw.c
+index e3c3e427309a..f73edaf6ce87 100644
+--- a/drivers/staging/fsl-dpaa2/ethsw/ethsw.c
++++ b/drivers/staging/fsl-dpaa2/ethsw/ethsw.c
+@@ -1086,6 +1086,7 @@ static int port_switchdev_event(struct notifier_block *unused,
+ dev_hold(dev);
+ break;
+ default:
++ kfree(switchdev_work);
+ return NOTIFY_DONE;
+ }
+
+--
+2.22.0
+
diff --git a/series.conf b/series.conf
index 2d84cd0c36..74e300349e 100644
--- a/series.conf
+++ b/series.conf
@@ -81,6 +81,7 @@
patches.kernel.org/5.2.1-052-staging-vchiq_2835_arm-revert-quit-using-custom.patch
patches.kernel.org/5.2.1-053-staging-vchiq-make-wait-events-interruptible.patch
patches.kernel.org/5.2.1-054-staging-vchiq-revert-switch-to-wait_for_complet.patch
+ patches.kernel.org/5.2.1-055-staging-fsl-dpaa2-ethsw-fix-memory-leak-of-swit.patch
########################################################
# Build fixes that apply to the vanilla kernel too.