Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

xirc2ps_cs: fix register access when enabling FullDuplex

The current code incorrectly passes (XIRCREG1_ECR | FullDuplex) as
the register address to GetByte(), instead of fetching the register
value and OR-ing it with FullDuplex. This results in an invalid
register access.

Fix it by reading XIRCREG1_ECR first, then or-ing with FullDuplex
before writing it back.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Link: https://patch.msgid.link/20250827192645.658496-1-alok.a.tiwari@oracle.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Alok Tiwari and committed by
Jakub Kicinski
b79e4980 9f74c0ea

+1 -1
+1 -1
drivers/net/ethernet/xircom/xirc2ps_cs.c
··· 1576 1576 msleep(40); /* wait 40 msec to let it complete */ 1577 1577 } 1578 1578 if (full_duplex) 1579 - PutByte(XIRCREG1_ECR, GetByte(XIRCREG1_ECR | FullDuplex)); 1579 + PutByte(XIRCREG1_ECR, GetByte(XIRCREG1_ECR) | FullDuplex); 1580 1580 } else { /* No MII */ 1581 1581 SelectPage(0); 1582 1582 value = GetByte(XIRCREG_ESR); /* read the ESR */