提交 e08ec545 编写于 作者: S Shravya Kumbham 提交者: Michal Simek

phy: zynqmp: Add conditions for return value check

The return value of xpsgtr_reset_release and xpsgtr_reset_assert
functions are stored in the ret variable but the value is overwritten
before it is used. So, check the return value of the ret variable.

Addresses-Coverity: Event value_overwrite.
Signed-off-by: NShravya Kumbham <shravya.kumbham@xilinx.com>
上级 5f393aca
......@@ -613,12 +613,20 @@ static int xpsgtr_controller_reset(struct xpsgtr_phy *gtr_phy)
switch (gtr_phy->type) {
case XPSGTR_TYPE_USB0:
ret = xpsgtr_reset_assert(gtr_dev->usb0_crst);
if (ret)
return ret;
ret = xpsgtr_reset_assert(gtr_dev->usb0_hibrst);
if (ret)
return ret;
ret = xpsgtr_reset_assert(gtr_dev->usb0_apbrst);
break;
case XPSGTR_TYPE_USB1:
ret = xpsgtr_reset_assert(gtr_dev->usb1_crst);
if (ret)
return ret;
ret = xpsgtr_reset_assert(gtr_dev->usb1_hibrst);
if (ret)
return ret;
ret = xpsgtr_reset_assert(gtr_dev->usb1_apbrst);
break;
case XPSGTR_TYPE_SATA_0:
......@@ -668,6 +676,8 @@ static int xpsgtr_controller_release_reset(struct xpsgtr_phy *gtr_phy)
xpsgtr_config_usbpipe(gtr_phy);
ret = xpsgtr_reset_release(gtr_dev->usb0_crst);
if (ret)
return ret;
ret = xpsgtr_reset_release(gtr_dev->usb0_hibrst);
break;
case XPSGTR_TYPE_USB1:
......@@ -677,6 +687,8 @@ static int xpsgtr_controller_release_reset(struct xpsgtr_phy *gtr_phy)
xpsgtr_config_usbpipe(gtr_phy);
ret = xpsgtr_reset_release(gtr_dev->usb1_crst);
if (ret)
return ret;
ret = xpsgtr_reset_release(gtr_dev->usb1_hibrst);
break;
case XPSGTR_TYPE_SATA_0:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册