]> git.baikalelectronics.ru Git - uboot.git/commit
net: eth-uclass: Fix for DM USB ethernet support
authorJean-Jacques Hiblot <jjhiblot@ti.com>
Thu, 9 Aug 2018 14:17:41 +0000 (16:17 +0200)
committerMarek Vasut <marex@denx.de>
Tue, 21 Aug 2018 14:21:37 +0000 (16:21 +0200)
commit43a10b66583d6bf5a5f2e62ef41b28f02dbdc445
tree74a9010dce505f97d25d2cd049cd4f7351ef56cc
parent60a4dc087b965d0c2450cff7d71e5b26dd615d2d
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>
net/eth-uclass.c