media: usb: dvd-usb: fix uninit-value bug in dibusb_read_eeprom_byte()
authorAnant Thazhemadam <anant.thazhemadam@gmail.com>
Mon, 7 Dec 2020 06:16:06 +0000 (07:16 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Nov 2021 18:16:14 +0000 (19:16 +0100)
commit74339549c8dcfa87c571de0a7d46b5e92cc3d537
treeb4e987e0d248730d9a1fd7c196f9cd3004daf03f
parent688ac68a23d460dfaa510c33bfa606949299d464
media: usb: dvd-usb: fix uninit-value bug in dibusb_read_eeprom_byte()

[ Upstream commit 899a61a3305d49e8a712e9ab20d0db94bde5929f ]

In dibusb_read_eeprom_byte(), if dibusb_i2c_msg() fails, val gets
assigned an value that's not properly initialized.
Using kzalloc() in place of kmalloc() for the buffer fixes this issue,
as the val can now be set to 0 in the event dibusb_i2c_msg() fails.

Reported-by: syzbot+e27b4fd589762b0b9329@syzkaller.appspotmail.com
Tested-by: syzbot+e27b4fd589762b0b9329@syzkaller.appspotmail.com
Signed-off-by: Anant Thazhemadam <anant.thazhemadam@gmail.com>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/usb/dvb-usb/dibusb-common.c