Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Linux-御风守护者
linux
提交
2afe37cd
L
linux
项目概览
Linux-御风守护者
/
linux
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
2afe37cd
编写于
11月 21, 2006
作者:
A
Arnaldo Carvalho de Melo
提交者:
David S. Miller
12月 02, 2006
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[ATM]: Use kmemdup & kzalloc where applicable
Signed-off-by:
N
Arnaldo Carvalho de Melo
<
acme@mandriva.com
>
上级
66625984
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
6 addition
and
13 deletion
+6
-13
net/atm/lec.c
net/atm/lec.c
+3
-7
net/atm/mpc.c
net/atm/mpc.c
+1
-2
net/atm/mpoa_caches.c
net/atm/mpoa_caches.c
+2
-4
未找到文件。
net/atm/lec.c
浏览文件 @
2afe37cd
...
@@ -1321,11 +1321,10 @@ static int lane2_resolve(struct net_device *dev, u8 *dst_mac, int force,
...
@@ -1321,11 +1321,10 @@ static int lane2_resolve(struct net_device *dev, u8 *dst_mac, int force,
if
(
table
==
NULL
)
if
(
table
==
NULL
)
return
-
1
;
return
-
1
;
*
tlvs
=
km
alloc
(
table
->
sizeoftlvs
,
GFP_ATOMIC
);
*
tlvs
=
km
emdup
(
table
->
tlvs
,
table
->
sizeoftlvs
,
GFP_ATOMIC
);
if
(
*
tlvs
==
NULL
)
if
(
*
tlvs
==
NULL
)
return
-
1
;
return
-
1
;
memcpy
(
*
tlvs
,
table
->
tlvs
,
table
->
sizeoftlvs
);
*
sizeoftlvs
=
table
->
sizeoftlvs
;
*
sizeoftlvs
=
table
->
sizeoftlvs
;
return
0
;
return
0
;
...
@@ -1364,11 +1363,10 @@ static int lane2_associate_req(struct net_device *dev, u8 *lan_dst,
...
@@ -1364,11 +1363,10 @@ static int lane2_associate_req(struct net_device *dev, u8 *lan_dst,
kfree
(
priv
->
tlvs
);
/* NULL if there was no previous association */
kfree
(
priv
->
tlvs
);
/* NULL if there was no previous association */
priv
->
tlvs
=
km
alloc
(
sizeoftlvs
,
GFP_KERNEL
);
priv
->
tlvs
=
km
emdup
(
tlvs
,
sizeoftlvs
,
GFP_KERNEL
);
if
(
priv
->
tlvs
==
NULL
)
if
(
priv
->
tlvs
==
NULL
)
return
(
0
);
return
(
0
);
priv
->
sizeoftlvs
=
sizeoftlvs
;
priv
->
sizeoftlvs
=
sizeoftlvs
;
memcpy
(
priv
->
tlvs
,
tlvs
,
sizeoftlvs
);
skb
=
alloc_skb
(
sizeoftlvs
,
GFP_ATOMIC
);
skb
=
alloc_skb
(
sizeoftlvs
,
GFP_ATOMIC
);
if
(
skb
==
NULL
)
if
(
skb
==
NULL
)
...
@@ -1409,12 +1407,10 @@ static void lane2_associate_ind(struct net_device *dev, u8 *mac_addr,
...
@@ -1409,12 +1407,10 @@ static void lane2_associate_ind(struct net_device *dev, u8 *mac_addr,
kfree(entry->tlvs);
kfree(entry->tlvs);
entry->tlvs = km
alloc(
sizeoftlvs, GFP_KERNEL);
entry->tlvs = km
emdup(tlvs,
sizeoftlvs, GFP_KERNEL);
if (entry->tlvs == NULL)
if (entry->tlvs == NULL)
return;
return;
entry->sizeoftlvs = sizeoftlvs;
entry->sizeoftlvs = sizeoftlvs;
memcpy(entry->tlvs, tlvs, sizeoftlvs);
#endif
#endif
#if 0
#if 0
printk("lec.c: lane2_associate_ind()\n");
printk("lec.c: lane2_associate_ind()\n");
...
...
net/atm/mpc.c
浏览文件 @
2afe37cd
...
@@ -1322,13 +1322,12 @@ static void set_mps_mac_addr_rcvd(struct k_message *msg, struct mpoa_client *cli
...
@@ -1322,13 +1322,12 @@ static void set_mps_mac_addr_rcvd(struct k_message *msg, struct mpoa_client *cli
if
(
client
->
number_of_mps_macs
)
if
(
client
->
number_of_mps_macs
)
kfree
(
client
->
mps_macs
);
kfree
(
client
->
mps_macs
);
client
->
number_of_mps_macs
=
0
;
client
->
number_of_mps_macs
=
0
;
client
->
mps_macs
=
km
alloc
(
ETH_ALEN
,
GFP_KERNEL
);
client
->
mps_macs
=
km
emdup
(
msg
->
MPS_ctrl
,
ETH_ALEN
,
GFP_KERNEL
);
if
(
client
->
mps_macs
==
NULL
)
{
if
(
client
->
mps_macs
==
NULL
)
{
printk
(
"mpoa: set_mps_mac_addr_rcvd: out of memory
\n
"
);
printk
(
"mpoa: set_mps_mac_addr_rcvd: out of memory
\n
"
);
return
;
return
;
}
}
client
->
number_of_mps_macs
=
1
;
client
->
number_of_mps_macs
=
1
;
memcpy
(
client
->
mps_macs
,
msg
->
MPS_ctrl
,
ETH_ALEN
);
return
;
return
;
}
}
...
...
net/atm/mpoa_caches.c
浏览文件 @
2afe37cd
...
@@ -87,7 +87,7 @@ static in_cache_entry *in_cache_get_by_vcc(struct atm_vcc *vcc,
...
@@ -87,7 +87,7 @@ static in_cache_entry *in_cache_get_by_vcc(struct atm_vcc *vcc,
static
in_cache_entry
*
in_cache_add_entry
(
__be32
dst_ip
,
static
in_cache_entry
*
in_cache_add_entry
(
__be32
dst_ip
,
struct
mpoa_client
*
client
)
struct
mpoa_client
*
client
)
{
{
in_cache_entry
*
entry
=
km
alloc
(
sizeof
(
in_cache_entry
),
GFP_KERNEL
);
in_cache_entry
*
entry
=
kz
alloc
(
sizeof
(
in_cache_entry
),
GFP_KERNEL
);
if
(
entry
==
NULL
)
{
if
(
entry
==
NULL
)
{
printk
(
"mpoa: mpoa_caches.c: new_in_cache_entry: out of memory
\n
"
);
printk
(
"mpoa: mpoa_caches.c: new_in_cache_entry: out of memory
\n
"
);
...
@@ -95,7 +95,6 @@ static in_cache_entry *in_cache_add_entry(__be32 dst_ip,
...
@@ -95,7 +95,6 @@ static in_cache_entry *in_cache_add_entry(__be32 dst_ip,
}
}
dprintk
(
"mpoa: mpoa_caches.c: adding an ingress entry, ip = %u.%u.%u.%u
\n
"
,
NIPQUAD
(
dst_ip
));
dprintk
(
"mpoa: mpoa_caches.c: adding an ingress entry, ip = %u.%u.%u.%u
\n
"
,
NIPQUAD
(
dst_ip
));
memset
(
entry
,
0
,
sizeof
(
in_cache_entry
));
atomic_set
(
&
entry
->
use
,
1
);
atomic_set
(
&
entry
->
use
,
1
);
dprintk
(
"mpoa: mpoa_caches.c: new_in_cache_entry: about to lock
\n
"
);
dprintk
(
"mpoa: mpoa_caches.c: new_in_cache_entry: about to lock
\n
"
);
...
@@ -447,7 +446,7 @@ static void eg_cache_remove_entry(eg_cache_entry *entry,
...
@@ -447,7 +446,7 @@ static void eg_cache_remove_entry(eg_cache_entry *entry,
static
eg_cache_entry
*
eg_cache_add_entry
(
struct
k_message
*
msg
,
struct
mpoa_client
*
client
)
static
eg_cache_entry
*
eg_cache_add_entry
(
struct
k_message
*
msg
,
struct
mpoa_client
*
client
)
{
{
eg_cache_entry
*
entry
=
k
m
alloc
(
sizeof
(
eg_cache_entry
),
GFP_KERNEL
);
eg_cache_entry
*
entry
=
k
z
alloc
(
sizeof
(
eg_cache_entry
),
GFP_KERNEL
);
if
(
entry
==
NULL
)
{
if
(
entry
==
NULL
)
{
printk
(
"mpoa: mpoa_caches.c: new_eg_cache_entry: out of memory
\n
"
);
printk
(
"mpoa: mpoa_caches.c: new_eg_cache_entry: out of memory
\n
"
);
...
@@ -455,7 +454,6 @@ static eg_cache_entry *eg_cache_add_entry(struct k_message *msg, struct mpoa_cli
...
@@ -455,7 +454,6 @@ static eg_cache_entry *eg_cache_add_entry(struct k_message *msg, struct mpoa_cli
}
}
dprintk
(
"mpoa: mpoa_caches.c: adding an egress entry, ip = %u.%u.%u.%u, this should be our IP
\n
"
,
NIPQUAD
(
msg
->
content
.
eg_info
.
eg_dst_ip
));
dprintk
(
"mpoa: mpoa_caches.c: adding an egress entry, ip = %u.%u.%u.%u, this should be our IP
\n
"
,
NIPQUAD
(
msg
->
content
.
eg_info
.
eg_dst_ip
));
memset
(
entry
,
0
,
sizeof
(
eg_cache_entry
));
atomic_set
(
&
entry
->
use
,
1
);
atomic_set
(
&
entry
->
use
,
1
);
dprintk
(
"mpoa: mpoa_caches.c: new_eg_cache_entry: about to lock
\n
"
);
dprintk
(
"mpoa: mpoa_caches.c: new_eg_cache_entry: about to lock
\n
"
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录