Few PHY drivers does not support lower power mode support.
Its better to check PHY dev and lower power function
pointer before deferencing them.
Coverity ID:489976
Bug
200192398
Change-Id: I586018664d66975692829768f98dd0a4590861c9
Signed-off-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-on: http://git-master/r/
1281948
Reviewed-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
* DAMAGE.
* ========================================================================= */
/*
- * Copyright (c) 2015-2016, NVIDIA CORPORATION. All rights reserved.
+ * Copyright (c) 2015-2017, NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
/* disable MAC TX */
hw_if->stop_mac_tx();
- if (pdata->phydev->drv->low_power_mode) {
+ if (pdata->phydev && pdata->phydev->drv &&
+ pdata->phydev->drv->low_power_mode) {
pdata->phydev->drv->low_power_mode(pdata->phydev, true);
if (!pdata->suspended)
phy_stop_interrupts(pdata->phydev);