Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
2710b57f
Commit
2710b57f
authored
Nov 21, 2006
by
Arnaldo Carvalho de Melo
Committed by
David S. Miller
Dec 02, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[TIPC]: Use kzalloc where appropriate
Signed-off-by:
Arnaldo Carvalho de Melo
<
acme@mandriva.com
>
parent
e69062b4
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
8 deletions
+4
-8
net/tipc/bcast.c
net/tipc/bcast.c
+2
-4
net/tipc/node.c
net/tipc/node.c
+1
-2
net/tipc/subscr.c
net/tipc/subscr.c
+1
-2
No files found.
net/tipc/bcast.c
View file @
2710b57f
...
...
@@ -774,8 +774,8 @@ int tipc_bclink_set_queue_limits(u32 limit)
int
tipc_bclink_init
(
void
)
{
bcbearer
=
k
m
alloc
(
sizeof
(
*
bcbearer
),
GFP_ATOMIC
);
bclink
=
k
m
alloc
(
sizeof
(
*
bclink
),
GFP_ATOMIC
);
bcbearer
=
k
z
alloc
(
sizeof
(
*
bcbearer
),
GFP_ATOMIC
);
bclink
=
k
z
alloc
(
sizeof
(
*
bclink
),
GFP_ATOMIC
);
if
(
!
bcbearer
||
!
bclink
)
{
nomem:
warn
(
"Multicast link creation failed, no memory
\n
"
);
...
...
@@ -786,14 +786,12 @@ int tipc_bclink_init(void)
return
-
ENOMEM
;
}
memset
(
bcbearer
,
0
,
sizeof
(
struct
bcbearer
));
INIT_LIST_HEAD
(
&
bcbearer
->
bearer
.
cong_links
);
bcbearer
->
bearer
.
media
=
&
bcbearer
->
media
;
bcbearer
->
media
.
send_msg
=
tipc_bcbearer_send
;
sprintf
(
bcbearer
->
media
.
name
,
"tipc-multicast"
);
bcl
=
&
bclink
->
link
;
memset
(
bclink
,
0
,
sizeof
(
struct
bclink
));
INIT_LIST_HEAD
(
&
bcl
->
waiting_ports
);
bcl
->
next_out_no
=
1
;
spin_lock_init
(
&
bclink
->
node
.
lock
);
...
...
net/tipc/node.c
View file @
2710b57f
...
...
@@ -60,7 +60,7 @@ struct node *tipc_node_create(u32 addr)
struct
node
*
n_ptr
;
struct
node
**
curr_node
;
n_ptr
=
k
m
alloc
(
sizeof
(
*
n_ptr
),
GFP_ATOMIC
);
n_ptr
=
k
z
alloc
(
sizeof
(
*
n_ptr
),
GFP_ATOMIC
);
if
(
!
n_ptr
)
{
warn
(
"Node creation failed, no memory
\n
"
);
return
NULL
;
...
...
@@ -75,7 +75,6 @@ struct node *tipc_node_create(u32 addr)
return
NULL
;
}
memset
(
n_ptr
,
0
,
sizeof
(
*
n_ptr
));
n_ptr
->
addr
=
addr
;
spin_lock_init
(
&
n_ptr
->
lock
);
INIT_LIST_HEAD
(
&
n_ptr
->
nsub
);
...
...
net/tipc/subscr.c
View file @
2710b57f
...
...
@@ -350,7 +350,7 @@ static void subscr_subscribe(struct tipc_subscr *s,
/* Allocate subscription object */
sub
=
k
m
alloc
(
sizeof
(
*
sub
),
GFP_ATOMIC
);
sub
=
k
z
alloc
(
sizeof
(
*
sub
),
GFP_ATOMIC
);
if
(
!
sub
)
{
warn
(
"Subscription rejected, no memory
\n
"
);
subscr_terminate
(
subscriber
);
...
...
@@ -359,7 +359,6 @@ static void subscr_subscribe(struct tipc_subscr *s,
/* Initialize subscription object */
memset
(
sub
,
0
,
sizeof
(
*
sub
));
sub
->
seq
.
type
=
htohl
(
s
->
seq
.
type
,
subscriber
->
swap
);
sub
->
seq
.
lower
=
htohl
(
s
->
seq
.
lower
,
subscriber
->
swap
);
sub
->
seq
.
upper
=
htohl
(
s
->
seq
.
upper
,
subscriber
->
swap
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment