Skip to content

Commit b94e5bd

Browse files
thazhemadamgregkh
authored andcommitted
media: usb: dvd-usb: fix uninit-value bug in dibusb_read_eeprom_byte()
[ Upstream commit 899a61a ] 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>
1 parent e3bc3e1 commit b94e5bd

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/media/usb/dvb-usb/dibusb-common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ int dibusb_read_eeprom_byte(struct dvb_usb_device *d, u8 offs, u8 *val)
223223
u8 *buf;
224224
int rc;
225225

226-
buf = kmalloc(2, GFP_KERNEL);
226+
buf = kzalloc(2, GFP_KERNEL);
227227
if (!buf)
228228
return -ENOMEM;
229229

0 commit comments

Comments
 (0)