From aca4dc5dad64fd4a35b3c964bfc5f79b9a38a6e8 Mon Sep 17 00:00:00 2001 From: Shaozhengchao Date: Fri, 25 Oct 2019 17:13:38 +0800 Subject: [PATCH] net/hinic: fix review comment driver inclusion category:bugfix bugzilla:4472 CVE:NA ----------------------------------------------------------------------- fix review comment Signed-off-by: Shaozhengchao Reviewed-by: Wangxiaoyun Signed-off-by: Yang Yingliang --- drivers/net/ethernet/huawei/hinic/hinic_mgmt.c | 4 ++-- drivers/net/ethernet/huawei/hinic/hinic_nic_dbg.c | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/huawei/hinic/hinic_mgmt.c b/drivers/net/ethernet/huawei/hinic/hinic_mgmt.c index 119155b8a158..1afbdb1f9f25 100644 --- a/drivers/net/ethernet/huawei/hinic/hinic_mgmt.c +++ b/drivers/net/ethernet/huawei/hinic/hinic_mgmt.c @@ -315,7 +315,7 @@ static int send_msg_to_mgmt_async(struct hinic_msg_pf_to_mgmt *pf_to_mgmt, return -EFAULT; if (cmd_size > MAX_MSG_SZ) - return -EFAULT; + return -EINVAL; if (direction == HINIC_MSG_RESPONSE) prepare_header(pf_to_mgmt, &header, msg_len, mod, HINIC_MSG_ACK, @@ -384,7 +384,7 @@ static int send_msg_to_mgmt_sync(struct hinic_msg_pf_to_mgmt *pf_to_mgmt, return -EFAULT; if (cmd_size > MAX_MSG_SZ) - return -EFAULT; + return -EINVAL; if (direction == HINIC_MSG_RESPONSE) prepare_header(pf_to_mgmt, &header, msg_len, mod, ack_type, diff --git a/drivers/net/ethernet/huawei/hinic/hinic_nic_dbg.c b/drivers/net/ethernet/huawei/hinic/hinic_nic_dbg.c index 35135e5274ca..ab47805ca369 100644 --- a/drivers/net/ethernet/huawei/hinic/hinic_nic_dbg.c +++ b/drivers/net/ethernet/huawei/hinic/hinic_nic_dbg.c @@ -31,7 +31,7 @@ #include "hinic_nic.h" #include "hinic_dbg.h" -#define INVALID_PI (65535) +#define INVALID_PI (0xFFFF) u16 hinic_dbg_get_qp_num(void *hwdev) { @@ -256,8 +256,7 @@ void hinic_get_chip_fault_stats(const void *hwdev, int copy_len = offset + MAX_DRV_BUF_SIZE - HINIC_CHIP_FAULT_SIZE; if (offset < 0 || offset > HINIC_CHIP_FAULT_SIZE) { - pr_err("Invalid chip offset value: %d\n", - offset); + pr_err("Invalid chip offset value: %d\n", offset); return; } -- GitLab