Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
77d04bd9
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
13
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
77d04bd9
编写于
4月 07, 2006
作者:
A
Andrew Morton
提交者:
David S. Miller
4月 09, 2006
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[NET]: More kzalloc conversions.
Signed-off-by:
N
David S. Miller
<
davem@davemloft.net
>
上级
31380de9
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
8 addition
and
22 deletion
+8
-22
net/core/dv.c
net/core/dv.c
+1
-4
net/core/flow.c
net/core/flow.c
+1
-3
net/core/gen_estimator.c
net/core/gen_estimator.c
+1
-2
net/core/neighbour.c
net/core/neighbour.c
+4
-10
net/core/request_sock.c
net/core/request_sock.c
+1
-3
未找到文件。
net/core/dv.c
浏览文件 @
77d04bd9
...
...
@@ -55,15 +55,12 @@ int alloc_divert_blk(struct net_device *dev)
dev
->
divert
=
NULL
;
if
(
dev
->
type
==
ARPHRD_ETHER
)
{
dev
->
divert
=
(
struct
divert_blk
*
)
kmalloc
(
alloc_size
,
GFP_KERNEL
);
dev
->
divert
=
kzalloc
(
alloc_size
,
GFP_KERNEL
);
if
(
dev
->
divert
==
NULL
)
{
printk
(
KERN_INFO
"divert: unable to allocate divert_blk for %s
\n
"
,
dev
->
name
);
return
-
ENOMEM
;
}
memset
(
dev
->
divert
,
0
,
sizeof
(
struct
divert_blk
));
dev_hold
(
dev
);
}
...
...
net/core/flow.c
浏览文件 @
77d04bd9
...
...
@@ -318,12 +318,10 @@ static void __devinit flow_cache_cpu_prepare(int cpu)
/* NOTHING */
;
flow_table
(
cpu
)
=
(
struct
flow_cache_entry
**
)
__get_free_pages
(
GFP_KERNEL
,
order
);
__get_free_pages
(
GFP_KERNEL
|
__GFP_ZERO
,
order
);
if
(
!
flow_table
(
cpu
))
panic
(
"NET: failed to allocate flow cache order %lu
\n
"
,
order
);
memset
(
flow_table
(
cpu
),
0
,
PAGE_SIZE
<<
order
);
flow_hash_rnd_recalc
(
cpu
)
=
1
;
flow_count
(
cpu
)
=
0
;
...
...
net/core/gen_estimator.c
浏览文件 @
77d04bd9
...
...
@@ -159,11 +159,10 @@ int gen_new_estimator(struct gnet_stats_basic *bstats,
if
(
parm
->
interval
<
-
2
||
parm
->
interval
>
3
)
return
-
EINVAL
;
est
=
k
m
alloc
(
sizeof
(
*
est
),
GFP_KERNEL
);
est
=
k
z
alloc
(
sizeof
(
*
est
),
GFP_KERNEL
);
if
(
est
==
NULL
)
return
-
ENOBUFS
;
memset
(
est
,
0
,
sizeof
(
*
est
));
est
->
interval
=
parm
->
interval
+
2
;
est
->
bstats
=
bstats
;
est
->
rate_est
=
rate_est
;
...
...
net/core/neighbour.c
浏览文件 @
77d04bd9
...
...
@@ -284,14 +284,11 @@ static struct neighbour **neigh_hash_alloc(unsigned int entries)
struct
neighbour
**
ret
;
if
(
size
<=
PAGE_SIZE
)
{
ret
=
k
m
alloc
(
size
,
GFP_ATOMIC
);
ret
=
k
z
alloc
(
size
,
GFP_ATOMIC
);
}
else
{
ret
=
(
struct
neighbour
**
)
__get_free_pages
(
GFP_ATOMIC
,
get_order
(
size
));
__get_free_pages
(
GFP_ATOMIC
|
__GFP_ZERO
,
get_order
(
size
));
}
if
(
ret
)
memset
(
ret
,
0
,
size
);
return
ret
;
}
...
...
@@ -1089,8 +1086,7 @@ static void neigh_hh_init(struct neighbour *n, struct dst_entry *dst,
if
(
hh
->
hh_type
==
protocol
)
break
;
if
(
!
hh
&&
(
hh
=
kmalloc
(
sizeof
(
*
hh
),
GFP_ATOMIC
))
!=
NULL
)
{
memset
(
hh
,
0
,
sizeof
(
struct
hh_cache
));
if
(
!
hh
&&
(
hh
=
kzalloc
(
sizeof
(
*
hh
),
GFP_ATOMIC
))
!=
NULL
)
{
rwlock_init
(
&
hh
->
hh_lock
);
hh
->
hh_type
=
protocol
;
atomic_set
(
&
hh
->
hh_refcnt
,
0
);
...
...
@@ -1366,13 +1362,11 @@ void neigh_table_init(struct neigh_table *tbl)
tbl
->
hash_buckets
=
neigh_hash_alloc
(
tbl
->
hash_mask
+
1
);
phsize
=
(
PNEIGH_HASHMASK
+
1
)
*
sizeof
(
struct
pneigh_entry
*
);
tbl
->
phash_buckets
=
k
m
alloc
(
phsize
,
GFP_KERNEL
);
tbl
->
phash_buckets
=
k
z
alloc
(
phsize
,
GFP_KERNEL
);
if
(
!
tbl
->
hash_buckets
||
!
tbl
->
phash_buckets
)
panic
(
"cannot allocate neighbour cache hashes"
);
memset
(
tbl
->
phash_buckets
,
0
,
phsize
);
get_random_bytes
(
&
tbl
->
hash_rnd
,
sizeof
(
tbl
->
hash_rnd
));
rwlock_init
(
&
tbl
->
lock
);
...
...
net/core/request_sock.c
浏览文件 @
77d04bd9
...
...
@@ -38,13 +38,11 @@ int reqsk_queue_alloc(struct request_sock_queue *queue,
{
const
int
lopt_size
=
sizeof
(
struct
listen_sock
)
+
nr_table_entries
*
sizeof
(
struct
request_sock
*
);
struct
listen_sock
*
lopt
=
k
m
alloc
(
lopt_size
,
GFP_KERNEL
);
struct
listen_sock
*
lopt
=
k
z
alloc
(
lopt_size
,
GFP_KERNEL
);
if
(
lopt
==
NULL
)
return
-
ENOMEM
;
memset
(
lopt
,
0
,
lopt_size
);
for
(
lopt
->
max_qlen_log
=
6
;
(
1
<<
lopt
->
max_qlen_log
)
<
sysctl_max_syn_backlog
;
lopt
->
max_qlen_log
++
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录