]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
tg3: prevent use of uninitialized remote_adv and local_adv variables
authorAlexey Simakov <bigalex934@gmail.com>
Tue, 14 Oct 2025 16:47:38 +0000 (19:47 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Oct 2025 13:03:08 +0000 (14:03 +0100)
commit01abf7b445062bc8f143f8bd0d4fb8c72fbfc491
tree24e8383cfb355c1d8ff56435b77a8f7336d6b116
parentc43fe40e67d69c64a5c51fc1da8a500d0e0b43fb
tg3: prevent use of uninitialized remote_adv and local_adv variables

[ Upstream commit 0c3f2e62815a43628e748b1e4ad97a1c46cce703 ]

Some execution paths that jump to the fiber_setup_done label
could leave the remote_adv and local_adv variables uninitialized
and then use it.

Initialize this variables at the point of definition to avoid this.

Fixes: 85730a631f0c ("tg3: Add SGMII phy support for 5719/5718 serdes")
Co-developed-by: Alexandr Sapozhnikov <alsp705@gmail.com>
Signed-off-by: Alexandr Sapozhnikov <alsp705@gmail.com>
Signed-off-by: Alexey Simakov <bigalex934@gmail.com>
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Link: https://patch.msgid.link/20251014164736.5890-1-bigalex934@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/broadcom/tg3.c