[U-Boot] [PATCH v2 4/6] net: mvpp2: no deref null
Ramon Fried
rfried.dev at gmail.com
Sat Aug 3 13:58:01 UTC 2019
On Sat, Aug 3, 2019 at 4:57 AM <nhed+uboot at starry.com> wrote:
>
> From: Nevo Hed <nhed+github at starry.com>
>
> phy_dev ptr is set from return of phy_connect() and is used before
> test to see if NULL. Obviously since the test already sxists someoen
Spelling.
> made the determination that this NULL is possible.
>
> Signed-off-by: Nevo Hed <nhed+github at starry.com>
> ---
> drivers/net/mvpp2.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/mvpp2.c b/drivers/net/mvpp2.c
> index fae7090121..5f908113f2 100644
> --- a/drivers/net/mvpp2.c
> +++ b/drivers/net/mvpp2.c
> @@ -4494,7 +4494,8 @@ static void mvpp2_phy_connect(struct udevice *dev, struct mvpp2_port *port)
> * an option because it is required for the phy_fw_down
> * procedure.
> */
> - if (phy_dev->drv->uid == 0xffffffff) {/* Generic phy */
> + if (phy_dev &&
> + phy_dev->drv->uid == 0xffffffff) {/* Generic phy */
> netdev_warn(port->dev,
> "Marking phy as invalid, link will not be checked\n");
> /* set phy_addr to invalid value */
> --
> 2.21.0
>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> https://lists.denx.de/listinfo/u-boot
Reviewed-By: Ramon Fried <rfried.dev at gmail.com>
More information about the U-Boot
mailing list