]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
media: dvb-usb: m920x: Fix a potential memory leak in m920x_i2c_xfer()
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Mon, 29 May 2023 05:58:36 +0000 (07:58 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 23 Sep 2023 08:46:57 +0000 (10:46 +0200)
commit809623fedc31f4e74039d93bb75a8993635d7534
treea560d08aa8e90002f52139c845746e8f193c0e18
parent76b08ed9666dd25011c86748c2acd189249d3123
media: dvb-usb: m920x: Fix a potential memory leak in m920x_i2c_xfer()

[ Upstream commit ea9ef6c2e001c5dc94bee35ebd1c8a98621cf7b8 ]

'read' is freed when it is known to be NULL, but not when a read error
occurs.

Revert the logic to avoid a small leak, should a m920x_read() call fail.

Fixes: a2ab06d7c4d6 ("media: m920x: don't use stack on USB reads")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/usb/dvb-usb/m920x.c