summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColin Ian King <colin.king@canonical.com>2019-06-08 12:50:31 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-07-14 08:01:14 +0200
commit67665643091aace6b966c9e5dbb526a6a42f32f2 (patch)
tree5b555438740a0aee94128a211961942bfbed9589
parent7fc7b746828b9d0baf836fe8e027a31df6ce5eb4 (diff)
downloadlinux-stable-67665643091aace6b966c9e5dbb526a6a42f32f2.tar.gz
linux-stable-67665643091aace6b966c9e5dbb526a6a42f32f2.tar.bz2
linux-stable-67665643091aace6b966c9e5dbb526a6a42f32f2.zip
staging: fsl-dpaa2/ethsw: fix memory leak of switchdev_work
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>
-rw-r--r--drivers/staging/fsl-dpaa2/ethsw/ethsw.c1
1 files changed, 1 insertions, 0 deletions
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;
}