mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-19 03:15:00 +00:00
net: eth-uclass: Fix for DM USB ethernet support
When a USB ethernet device is halted, the device driver is removed. When this happens the uclass private memory is freed and uclass_priv is set to NULL. This causes a data abort when uclass_priv->state is then set to ETH_STATE_PASSIVE. Fix it by checking if uclass_priv is NULL before setting uclass_priv->state Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
This commit is contained in:
parent
c73251eac1
commit
c3211708cf
1 changed files with 2 additions and 1 deletions
|
@ -312,7 +312,8 @@ void eth_halt(void)
|
||||||
|
|
||||||
eth_get_ops(current)->stop(current);
|
eth_get_ops(current)->stop(current);
|
||||||
priv = current->uclass_priv;
|
priv = current->uclass_priv;
|
||||||
priv->state = ETH_STATE_PASSIVE;
|
if (priv)
|
||||||
|
priv->state = ETH_STATE_PASSIVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
int eth_is_active(struct udevice *dev)
|
int eth_is_active(struct udevice *dev)
|
||||||
|
|
Loading…
Add table
Reference in a new issue