From e52e2bc5b486c9f3bbd5f3f1a73cab2aec7aaf0e Mon Sep 17 00:00:00 2001 From: gechangwei Date: Mon, 9 Sep 2019 17:31:32 +0800 Subject: [PATCH] =?UTF-8?q?MOD=20aaa-12=20=E4=BB=A3=E7=A0=81=E4=BC=98?= =?UTF-8?q?=E5=8C=96=20SOL=20=E4=BF=AE=E6=94=B9=E4=BA=BA=EF=BC=9Agechangwe?= =?UTF-8?q?i=20=E6=A3=80=E8=A7=86=E4=BA=BA=EF=BC=9Agechangwei?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: gechangwei --- Platform/modules/netlink_api/libnetlink_k.c | 16 ++++++++-------- Platform/modules/pdelivery/pdeliverynl_kinit.c | 10 +++++----- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Platform/modules/netlink_api/libnetlink_k.c b/Platform/modules/netlink_api/libnetlink_k.c index 051f35e50..9e2d8fafb 100755 --- a/Platform/modules/netlink_api/libnetlink_k.c +++ b/Platform/modules/netlink_api/libnetlink_k.c @@ -153,9 +153,9 @@ int debugfs_prk_onoff(struct netlinkk_cfg *g_nlcfg, struct nlmsghdr *nlh,struct unsigned char * cookies = "test cookies"; int err, len = 0; - char *pload; - struct nlattr *rta; - char* load; + char *pload = NULL; + struct nlattr *rta = NULL; + char* load = NULL; unsigned long fk_type; pload = nlmsg_data(nlh); @@ -218,12 +218,12 @@ int debugfs_pkt_num_stati_witisend(struct netlinkk_cfg *g_nlcfg, struct nlmsghdr *nlh,struct commnl_msgtype_process* msg_process) { int err; - struct sk_buff *out_skb; - struct nlmsghdr *out_nlh; + struct sk_buff *out_skb = NULL; + struct nlmsghdr *out_nlh = NULL; unsigned int length = sizeof(struct netlink_debugfs); - char *pload; - struct nlattr *rta; - char* load; + char *pload = NULL; + struct nlattr *rta = NULL; + char* load = NULL; unsigned long fk_type; struct netlink_debugfs * tmp_dfs = NULL; diff --git a/Platform/modules/pdelivery/pdeliverynl_kinit.c b/Platform/modules/pdelivery/pdeliverynl_kinit.c index d984cfb5c..3c8a6e6c6 100644 --- a/Platform/modules/pdelivery/pdeliverynl_kinit.c +++ b/Platform/modules/pdelivery/pdeliverynl_kinit.c @@ -204,10 +204,10 @@ unsigned int pdelivery_hook_func(void *priv, struct sk_buff *skb, const struct nf_hook_state *state) { - void *payload; - struct sk_buff *out_skb; - void *out_payload; - struct nlmsghdr *out_nlh; + void *payload = NULL; + struct sk_buff *out_skb = NULL; + void *out_payload = NULL; + struct nlmsghdr *out_nlh = NULL; int payload_len; // with padding, but ok for echo //struct iphdr *iph; int ret = -1; @@ -224,7 +224,7 @@ unsigned int pdelivery_hook_func(void *priv, payload_len = skb->len + skb->mac_len;/**/ - out_skb = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); //分配足以存放默认大小的sk_buff + out_skb = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_ATOMIC); //分配足以存放默认大小的sk_buff if (!out_skb) { goto failure;