From 39c5e922dd37ad9466de8e08bd8b54786e11d586 Mon Sep 17 00:00:00 2001 From: Shaozhengchao Date: Tue, 10 Dec 2019 11:29:05 +0800 Subject: [PATCH 2782/2944] openeuler: net/hinic: fix static check problem commit 6a1f91a2880353279506b0001d74d942c0defcfb openEuler-1.0 driver inclusion category:bugfix bugzilla:4472 CVE:NA ----------------------------------------------------------------------- fix static check problem Signed-off-by: Shaozhengchao Reviewed-by: Luoshaokai Signed-off-by: Yang Yingliang Signed-off-by: Xin Hao Reviewed-by: Baolin Wang --- 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 b2599b5..85e7be2 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 f281c19..377ac67 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; } -- 1.8.3.1