net: ti: fix UAF in tlan_remove_one
authorPavel Skripkin <paskripkin@gmail.com>
Fri, 9 Jul 2021 14:58:29 +0000 (17:58 +0300)
committerDavid S. Miller <davem@davemloft.net>
Fri, 9 Jul 2021 18:01:01 +0000 (11:01 -0700)
commit0336f8ffece62f882ab3012820965a786a983f70
tree88942d2c0c3b4f3873c9ed53ff04c10909fc6a93
parentad297cd2db8953e2202970e9504cab247b6c7cb4
net: ti: fix UAF in tlan_remove_one

priv is netdev private data and it cannot be
used after free_netdev() call. Using priv after free_netdev()
can cause UAF bug. Fix it by moving free_netdev() at the end of the
function.

Fixes: 1e0a8b13d355 ("tlan: cancel work at remove path")
Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ti/tlan.c