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)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Thu, 1 Feb 2024 12:49:18 +0000 (13:49 +0100)
commitdc9ceb90c4b42c6e5c6757df1d6257110433788e
tree660b2d2c2c64df2cc7c561a256325cd8d6b4de0c
parent6a9d552483d50953320b9d3b57abdee8d436f23f
media: ir_toy: fix a memleak in irtoy_tx

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>
drivers/media/rc/ir_toy.c