Commit 4279f7b8 authored by Colin Ian King's avatar Colin Ian King Committed by Greg Kroah-Hartman

staging: fsl-dpaa2/ethsw: fix memory leak of switchdev_work

commit 5555ebbb 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: 44baaa43 ("staging: fsl-dpaa2/ethsw: Add Freescale DPAA2 Ethernet Switch driver")
Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 5e8051fc
...@@ -1086,6 +1086,7 @@ static int port_switchdev_event(struct notifier_block *unused, ...@@ -1086,6 +1086,7 @@ static int port_switchdev_event(struct notifier_block *unused,
dev_hold(dev); dev_hold(dev);
break; break;
default: default:
kfree(switchdev_work);
return NOTIFY_DONE; return NOTIFY_DONE;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment