From: Junxin Chen chenjunxin1@huawei.com
driver inclusion category: bugfix bugzilla: NA CVE: NA
----------------------------------
THIS_MODULE is a pointer that need to be inited by insmod or modprobe, which may cause access NULL pointer when kernel config is y.
This patch remove THIS_MODULE to avoid it, and change version to 1.9.29.0.
Signed-off-by: Junxin Chen chenjunxin1@huawei.com Reviewed-by: Zhong Zhaohui zhongzhaohui@huawei.com Signed-off-by: Yang Yingliang yangyingliang@huawei.com --- drivers/net/ethernet/hisilicon/hns3/hnae3.h | 2 +- .../net/ethernet/hisilicon/hns3/hns-customer/hns3_enet_it.c | 2 +- drivers/net/ethernet/hisilicon/hns3/hns3_cae/hns3_cae_init.c | 2 +- .../net/ethernet/hisilicon/hns3/hns3_cae/hns3_cae_version.c | 4 ++-- .../net/ethernet/hisilicon/hns3/hns3_cae/hns3_cae_version.h | 2 +- drivers/net/ethernet/hisilicon/hns3/hns3_enet.h | 2 +- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h | 2 +- drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/net/ethernet/hisilicon/hns3/hnae3.h b/drivers/net/ethernet/hisilicon/hns3/hnae3.h index 739a0266e8fd..bcd8c183d2b4 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hnae3.h +++ b/drivers/net/ethernet/hisilicon/hns3/hnae3.h @@ -30,7 +30,7 @@ #include <linux/pci.h> #include <linux/types.h>
-#define HNAE3_MOD_VERSION "1.0" +#define HNAE3_MOD_VERSION "1.9.29.0"
#define HNAE3_MIN_VECTOR_NUM 2 /* one for msi-x, another for IO */
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns-customer/hns3_enet_it.c b/drivers/net/ethernet/hisilicon/hns3/hns-customer/hns3_enet_it.c index b98729512ded..a6a724da0548 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns-customer/hns3_enet_it.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns-customer/hns3_enet_it.c @@ -51,7 +51,7 @@ static int __init hns3_init_module_it(void) pr_info("%s: %s - version\n", hns3_driver_name, hns3_driver_string); pr_info("%s: %s\n", hns3_driver_name, hns3_copyright);
- strncpy(hns3_driver_version, THIS_MODULE->version, + strncpy(hns3_driver_version, HNS3_MOD_VERSION, strlen(hns3_driver_version));
client.type = HNAE3_CLIENT_KNIC; diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_cae/hns3_cae_init.c b/drivers/net/ethernet/hisilicon/hns3/hns3_cae/hns3_cae_init.c index 0c5db2241ce4..cb61e673cba3 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3_cae/hns3_cae_init.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_cae/hns3_cae_init.c @@ -563,5 +563,5 @@ static void __exit hns3_cae_exit(void) module_init(hns3_cae_init); module_exit(hns3_cae_exit); MODULE_DESCRIPTION("HNS3 CAE Driver"); -MODULE_VERSION(HNAE_DRIVER_VERSION); +MODULE_VERSION(HNS3_CAE_MOD_VERSION); MODULE_LICENSE("GPL"); diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_cae/hns3_cae_version.c b/drivers/net/ethernet/hisilicon/hns3/hns3_cae/hns3_cae_version.c index b55eaf2011af..53e1354808fb 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3_cae/hns3_cae_version.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_cae/hns3_cae_version.c @@ -79,10 +79,10 @@ int hns3_cae_get_driver_ver(struct hns3_nic_priv *nic_dev, void *buf_in, u32 in_size, void *buf_out, u32 out_size) { - if (!buf_out || out_size < strlen(THIS_MODULE->version)) + if (!buf_out || out_size < strlen(HNS3_CAE_MOD_VERSION)) return -ENOMEM;
- strncpy(buf_out, THIS_MODULE->version, strlen(THIS_MODULE->version)); + strncpy(buf_out, HNS3_CAE_MOD_VERSION, strlen(HNS3_CAE_MOD_VERSION));
return 0; } diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_cae/hns3_cae_version.h b/drivers/net/ethernet/hisilicon/hns3/hns3_cae/hns3_cae_version.h index 3e0711d0494f..e2e96edcb820 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3_cae/hns3_cae_version.h +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_cae/hns3_cae_version.h @@ -4,7 +4,7 @@ #ifndef __HNS3_CAE_VERSION_H__ #define __HNS3_CAE_VERSION_H__
-#define HNAE_DRIVER_VERSION "1.9.25.2" +#define HNS3_CAE_MOD_VERSION "1.9.29.0"
#define CMT_ID_LEN 8 #define RESV_LEN 3 diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h index e9737ad84892..d09599a877af 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h @@ -8,7 +8,7 @@
#include "hnae3.h"
-#define HNS3_MOD_VERSION "1.9.26.0" +#define HNS3_MOD_VERSION "1.9.29.0"
extern char hns3_driver_version[];
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h index f6a8919bd398..0b5c13241335 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h @@ -12,7 +12,7 @@ #include "hclge_cmd.h" #include "hnae3.h"
-#define HCLGE_MOD_VERSION "1.9.26.0" +#define HCLGE_MOD_VERSION "1.9.29.0" #define HCLGE_DRIVER_NAME "hclge"
#define HCLGE_MAX_PF_NUM 8 diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h index 72dec4359bcf..1e963a35a76e 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h +++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h @@ -10,7 +10,7 @@ #include "hclgevf_cmd.h" #include "hnae3.h"
-#define HCLGEVF_MOD_VERSION "1.0" +#define HCLGEVF_MOD_VERSION "1.9.29.0" #define HCLGEVF_DRIVER_NAME "hclgevf"
#define HCLGEVF_MAX_VLAN_ID 4095