From 9a93c2608a3b9b4c8925de6d9823711cebc2ad5b Mon Sep 17 00:00:00 2001 From: Shaozhengchao Date: Tue, 10 Dec 2019 11:29:05 +0800 Subject: [PATCH] net/hinic: fix static check problem driver inclusion category:bugfix bugzilla:4472 CVE:NA ----------------------------------------------------------------------- fix static check problem Signed-off-by: Shaozhengchao Reviewed-by: Luoshaokai Signed-off-by: Yang Yingliang --- 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; } -- GitLab