]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
netdevsim: switch to memdup_user_nul()
authorWei Yongjun <weiyongjun1@huawei.com>
Wed, 24 Mar 2021 14:42:20 +0000 (14:42 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Jan 2025 12:24:52 +0000 (13:24 +0100)
commit2fb425f27ee6ea572adeb6c259d039dea89a308e
treedf8f8e9d15b7972999a83a98872e42279d0a4563
parent82c7ad9ca09975aae737abffd66d1ad98874c13d
netdevsim: switch to memdup_user_nul()

[ Upstream commit 20fd4f421cf4c21ab37a8bf31db50c69f1b49355 ]

Use memdup_user_nul() helper instead of open-coding to
simplify the code.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Stable-dep-of: ee76746387f6 ("netdevsim: prevent bad user input in nsim_dev_health_break_write()")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/netdevsim/health.c