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
nexedi
linux
Commits
2afe37cd
Commit
2afe37cd
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
[ATM]: Use kmemdup & kzalloc where applicable
Signed-off-by:
Arnaldo Carvalho de Melo
<
acme@mandriva.com
>
parent
66625984
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
13 deletions
+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
No files found.
net/atm/lec.c
View file @
2afe37cd
...
...
@@ -1321,11 +1321,10 @@ static int lane2_resolve(struct net_device *dev, u8 *dst_mac, int force,
if
(
table
==
NULL
)
return
-
1
;
*
tlvs
=
km
alloc
(
table
->
sizeoftlvs
,
GFP_ATOMIC
);
*
tlvs
=
km
emdup
(
table
->
tlvs
,
table
->
sizeoftlvs
,
GFP_ATOMIC
);
if
(
*
tlvs
==
NULL
)
return
-
1
;
memcpy
(
*
tlvs
,
table
->
tlvs
,
table
->
sizeoftlvs
);
*
sizeoftlvs
=
table
->
sizeoftlvs
;
return
0
;
...
...
@@ -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 */
priv
->
tlvs
=
km
alloc
(
sizeoftlvs
,
GFP_KERNEL
);
priv
->
tlvs
=
km
emdup
(
tlvs
,
sizeoftlvs
,
GFP_KERNEL
);
if
(
priv
->
tlvs
==
NULL
)
return
(
0
);
priv
->
sizeoftlvs
=
sizeoftlvs
;
memcpy
(
priv
->
tlvs
,
tlvs
,
sizeoftlvs
);
skb
=
alloc_skb
(
sizeoftlvs
,
GFP_ATOMIC
);
if
(
skb
==
NULL
)
...
...
@@ -1409,12 +1407,10 @@ static void lane2_associate_ind(struct net_device *dev, u8 *mac_addr,
kfree(entry->tlvs);
entry->tlvs = km
alloc(
sizeoftlvs, GFP_KERNEL);
entry->tlvs = km
emdup(tlvs,
sizeoftlvs, GFP_KERNEL);
if (entry->tlvs == NULL)
return;
entry->sizeoftlvs = sizeoftlvs;
memcpy(entry->tlvs, tlvs, sizeoftlvs);
#endif
#if 0
printk("lec.c: lane2_associate_ind()\n");
...
...
net/atm/mpc.c
View file @
2afe37cd
...
...
@@ -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
)
kfree
(
client
->
mps_macs
);
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
)
{
printk
(
"mpoa: set_mps_mac_addr_rcvd: out of memory
\n
"
);
return
;
}
client
->
number_of_mps_macs
=
1
;
memcpy
(
client
->
mps_macs
,
msg
->
MPS_ctrl
,
ETH_ALEN
);
return
;
}
...
...
net/atm/mpoa_caches.c
View file @
2afe37cd
...
...
@@ -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
,
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
)
{
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,
}
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
);
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,
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
)
{
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
}
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
);
dprintk
(
"mpoa: mpoa_caches.c: new_eg_cache_entry: about to lock
\n
"
);
...
...
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