]> 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)
committerJakub Kicinski <kuba@kernel.org>
Thu, 16 Oct 2025 00:16:49 +0000 (17:16 -0700)
commit0c3f2e62815a43628e748b1e4ad97a1c46cce703
tree23393efa2febf2f2b624ced593f841ae676f967d
parentbc384963bc18e4f21cf8615b57cbbc9c5e0d309a
tg3: prevent use of uninitialized remote_adv and local_adv variables

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>
drivers/net/ethernet/broadcom/tg3.c