slip: stop double free sl->dev in slip_open
authoryangerkun <yangerkun@huawei.com>
Fri, 28 Feb 2020 13:40:48 +0000 (21:40 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 11 Mar 2020 06:53:07 +0000 (07:53 +0100)
commite7fe43afa869bc5931d046707b872fdc19946bf3
treefb007316919be5238434263a15e05211378c327c
parent24d85373578acb9566852a0e094ff33e71b5a924
slip: stop double free sl->dev in slip_open

After include 3b5a39979daf ("slip: Fix memory leak in slip_open error path")
and e58c19124189 ("slip: Fix use-after-free Read in slip_open") with 4.4.y/4.9.y.
We will trigger a bug since we can double free sl->dev in slip_open. Actually,
we should backport cf124db566e6 ("net: Fix inconsistent teardown and release
of private netdev state.") too since it has delete free_netdev from sl_free_netdev.
Fix it by delete free_netdev from slip_open.

Signed-off-by: yangerkun <yangerkun@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/slip/slip.c