Commit 1a67dc5c authored by Wei Chen's avatar Wei Chen Committed by sanglipeng
Browse files

media: dvb-usb: dw2102: fix uninit-value in su3000_read_mac_address

stable inclusion
from stable-v5.10.183
commit 74c80d2024d99fb01a7b0d898ad7ac8380d45aab
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I8IRR2

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=74c80d2024d99fb01a7b0d898ad7ac8380d45aab

--------------------------------

[ Upstream commit a3fd1ef2 ]

In su3000_read_mac_address, if i2c_transfer fails to execute two
messages, array mac address will not be initialized. Without handling
such error, later in function dvb_usb_adapter_dvb_init, proposed_mac
is accessed before initialization.

Fix this error by returning a negative value if message execution fails.

Link: https://lore.kernel.org/linux-media/20230328124416.560889-1-harperchen1110@gmail.com


Signed-off-by: default avatarWei Chen <harperchen1110@gmail.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarsanglipeng <sanglipeng1@jd.com>
parent 3185ffce
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment