]> www.infradead.org Git - nvme.git/commit
net: ipv4: fix a memleak in ip_setup_cork
authorZhipeng Lu <alexious@zju.edu.cn>
Mon, 29 Jan 2024 09:10:17 +0000 (17:10 +0800)
committerJakub Kicinski <kuba@kernel.org>
Wed, 31 Jan 2024 23:53:25 +0000 (15:53 -0800)
commit5dee6d6923458e26966717f2a3eae7d09fc10bf6
treee49ea1341bb3d770af69ea056742488ba22f979a
parente028243003ad6e1417cc8ac19af9ded672b9ec59
net: ipv4: fix a memleak in ip_setup_cork

When inetdev_valid_mtu fails, cork->opt should be freed if it is
allocated in ip_setup_cork. Otherwise there could be a memleak.

Fixes: 501a90c94510 ("inet: protect against too small mtu values.")
Signed-off-by: Zhipeng Lu <alexious@zju.edu.cn>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Link: https://lore.kernel.org/r/20240129091017.2938835-1-alexious@zju.edu.cn
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/ipv4/ip_output.c