]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: usb: lan78xx: fix use of improperly initialized dev->chipid in lan78xx_reset
authorI Viswanath <viswanathiyyappan@gmail.com>
Mon, 13 Oct 2025 18:16:48 +0000 (23:46 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Oct 2025 13:04:34 +0000 (14:04 +0100)
commitb2adaa150b07b17979d60a846ba710fc152f6b7e
treeb55caa230f9fda603bf58e01d1f4cbf3a90b8d8d
parent9c4dca6a07e3b097d8f6ee06cf93c31885ec82ab
net: usb: lan78xx: fix use of improperly initialized dev->chipid in lan78xx_reset

[ Upstream commit 8d93ff40d49d70e05c82a74beae31f883fe0eaf8 ]

dev->chipid is used in lan78xx_init_mac_address before it's initialized:

lan78xx_reset() {
    lan78xx_init_mac_address()
        lan78xx_read_eeprom()
            lan78xx_read_raw_eeprom() <- dev->chipid is used here

    dev->chipid = ... <- dev->chipid is initialized correctly here
}

Reorder initialization so that dev->chipid is set before calling
lan78xx_init_mac_address().

Fixes: a0db7d10b76e ("lan78xx: Add to handle mux control per chip id")
Signed-off-by: I Viswanath <viswanathiyyappan@gmail.com>
Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Reviewed-by: Khalid Aziz <khalid@kernel.org>
Link: https://patch.msgid.link/20251013181648.35153-1-viswanathiyyappan@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/usb/lan78xx.c