diff options
author | Colin Ian King <colin.king@canonical.com> | 2019-06-08 14:50:31 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-06-09 14:07:23 +0300 |
commit | 5555ebbbac822b4fa28db2be15aaf98b3c21af26 (patch) | |
tree | 8f9c8147f0fb3e37aceb726d3f0631c41817c155 /drivers/staging/fsl-dpaa2 | |
parent | 7a58b4abc7744da76b7a3c25589103705ea0df2f (diff) | |
download | linux-5555ebbbac822b4fa28db2be15aaf98b3c21af26.tar.xz |
staging: fsl-dpaa2/ethsw: fix memory leak of switchdev_work
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>
Diffstat (limited to 'drivers/staging/fsl-dpaa2')
-rw-r--r-- | drivers/staging/fsl-dpaa2/ethsw/ethsw.c | 1 |
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; } |