]> git.hungrycats.org Git - linux/commit
media: ir_toy: fix a memleak in irtoy_tx
authorZhipeng Lu <alexious@zju.edu.cn>
Wed, 17 Jan 2024 08:14:19 +0000 (09:14 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 23 Feb 2024 07:55:04 +0000 (08:55 +0100)
commit207557e393a135c1b6fe1df7cc0741d2c1789fff
tree3bc6c8c433b3ae20f091462d32a3ce4a1f676749
parent88936ceab6b426f1312327e9ef849c215c6007a7
media: ir_toy: fix a memleak in irtoy_tx

[ Upstream commit dc9ceb90c4b42c6e5c6757df1d6257110433788e ]

When irtoy_command fails, buf should be freed since it is allocated by
irtoy_tx, or there is a memleak.

Fixes: 4114978dcd24 ("media: ir_toy: prevent device from hanging during transmit")
Signed-off-by: Zhipeng Lu <alexious@zju.edu.cn>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/rc/ir_toy.c