Skip to content

Commit 6348069

Browse files
aloktiwagregkh
authored andcommitted
xirc2ps_cs: fix register access when enabling FullDuplex
[ Upstream commit b79e498 ] 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: 1da177e ("Linux-2.6.12-rc2") Signed-off-by: Alok Tiwari <[email protected]> Reviewed-by: Simon Horman <[email protected]> Reviewed-by: Jacob Keller <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent a22ec2e commit 6348069

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/ethernet/xircom/xirc2ps_cs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1576,7 +1576,7 @@ do_reset(struct net_device *dev, int full)
15761576
msleep(40); /* wait 40 msec to let it complete */
15771577
}
15781578
if (full_duplex)
1579-
PutByte(XIRCREG1_ECR, GetByte(XIRCREG1_ECR | FullDuplex));
1579+
PutByte(XIRCREG1_ECR, GetByte(XIRCREG1_ECR) | FullDuplex);
15801580
} else { /* No MII */
15811581
SelectPage(0);
15821582
value = GetByte(XIRCREG_ESR); /* read the ESR */

0 commit comments

Comments
 (0)