mirror of https://gitee.com/openkylin/linux.git
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: 44baaa43d7
("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>
This commit is contained in:
parent
7a58b4abc7
commit
5555ebbbac
|
@ -1086,6 +1086,7 @@ static int port_switchdev_event(struct notifier_block *unused,
|
|||
dev_hold(dev);
|
||||
break;
|
||||
default:
|
||||
kfree(switchdev_work);
|
||||
return NOTIFY_DONE;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue