Skip to content
Commit 7b4ea2d8 authored by Michal Simek's avatar Michal Simek Committed by Tom Rini
Browse files

phy: Fix u-boot coruption when fixed-phy is used



When fixed-link phy is used subnode offset is used as phy address. This
number is bigger then space allocated for bus structure (allocated via
mdio_alloc).
bus->phymap[] array has PHY_MAX_ADDR size (32).
That's why writing bus->phymap[addr] where addr is < 0 or > PHY_MAX_ADDR
is causing write to memory which can caused full U-Boot crash.

The patch is checking if address is in correct range.

Signed-off-by: default avatarMichal Simek <michal.simek@xilinx.com>
parent adc702e2
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment