]> git.itanic.dy.fi Git - linux-stable/commit
net: tun: rebuild error handling in tun_get_user
authorChuang Wang <nashuiliang@gmail.com>
Thu, 10 Nov 2022 07:31:25 +0000 (15:31 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 24 May 2023 16:32:47 +0000 (17:32 +0100)
commite2d59768f851c1726d6d0df63a6ae4c5e39786a0
tree7db420ee763381caaeb4af0a744928eb9fa21175
parentae42c6f79cec7314e608f43e767253bfeab612ee
net: tun: rebuild error handling in tun_get_user

[ Upstream commit ab00af85d2f886a8e4ace1342d9cc2b232eab6a8 ]

The error handling in tun_get_user is very scattered.
This patch unifies error handling, reduces duplication of code, and
makes the logic clearer.

Signed-off-by: Chuang Wang <nashuiliang@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Stable-dep-of: 82b2bc279467 ("tun: Fix memory leak for detached NAPI queue.")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/tun.c