From: Shaozhengchao <shaozhengchao(a)huawei.com>
commit 6a1f91a2880353279506b0001d74d942c0defcfb openEuler-1.0
driver inclusion
category:bugfix
bugzilla:4472
CVE:NA
-----------------------------------------------------------------------
fix static check problem
Signed-off-by: Shaozhengchao <shaozhengchao(a)huawei.com>
Reviewed-by: Luoshaokai <luoshaokai(a)huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang(a)huawei.com>
Signed-off-by: Xin Hao <haoxing990(a)gmail.com>
---
drivers/net/ethernet/huawei/hinic/hinic_cfg.c | 1 +
drivers/net/ethernet/huawei/hinic/hinic_nictool.c | 7 +++----
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/huawei/hinic/hinic_cfg.c
b/drivers/net/ethernet/huawei/hinic/hinic_cfg.c
index b2599b5c20cd..85e7be285132 100644
--- a/drivers/net/ethernet/huawei/hinic/hinic_cfg.c
+++ b/drivers/net/ethernet/huawei/hinic/hinic_cfg.c
@@ -104,6 +104,7 @@ int hinic_sync_time(void *hwdev, u64 time)
sdk_err(((struct hinic_hwdev *)hwdev)->dev_hdl,
"Failed to sync time to mgmt, err: %d, status: 0x%x, out size: 0x%x\n",
err, time_info.status, out_size);
+ return -EFAULT;
}
return err;
diff --git a/drivers/net/ethernet/huawei/hinic/hinic_nictool.c
b/drivers/net/ethernet/huawei/hinic/hinic_nictool.c
index f281c19a275b..377ac678b4e8 100644
--- a/drivers/net/ethernet/huawei/hinic/hinic_nictool.c
+++ b/drivers/net/ethernet/huawei/hinic/hinic_nictool.c
@@ -1545,10 +1545,8 @@ static int send_to_nic_driver(struct hinic_nic_dev *nic_dev,
}
mutex_unlock(&nic_dev->nic_mutex);
- if (index == num_cmds) {
- pr_err("Can't find callback for %d\n", cmd_type);
+ if (index == num_cmds)
return -EINVAL;
- }
return err;
}
@@ -1571,7 +1569,8 @@ static int send_to_hw_driver(void *hwdev, struct msg_module
*nt_msg,
break;
}
}
-
+ if (index == num_cmds)
+ return -EINVAL;
return err;
}
--
2.31.0