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
e69062b4
Commit
e69062b4
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
[SUNRPC]: Use k{mem,str}dup where applicable
Signed-off-by:
Arnaldo Carvalho de Melo
<
acme@mandriva.com
>
parent
af997d8c
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
6 additions
and
13 deletions
+6
-13
net/sunrpc/auth_gss/auth_gss.c
net/sunrpc/auth_gss/auth_gss.c
+1
-2
net/sunrpc/auth_gss/gss_krb5_mech.c
net/sunrpc/auth_gss/gss_krb5_mech.c
+1
-2
net/sunrpc/auth_gss/gss_spkm3_mech.c
net/sunrpc/auth_gss/gss_spkm3_mech.c
+1
-2
net/sunrpc/auth_gss/svcauth_gss.c
net/sunrpc/auth_gss/svcauth_gss.c
+2
-5
net/sunrpc/clnt.c
net/sunrpc/clnt.c
+1
-2
No files found.
net/sunrpc/auth_gss/auth_gss.c
View file @
e69062b4
...
...
@@ -198,11 +198,10 @@ simple_get_netobj(const void *p, const void *end, struct xdr_netobj *dest)
q
=
(
const
void
*
)((
const
char
*
)
p
+
len
);
if
(
unlikely
(
q
>
end
||
q
<
p
))
return
ERR_PTR
(
-
EFAULT
);
dest
->
data
=
km
alloc
(
len
,
GFP_KERNEL
);
dest
->
data
=
km
emdup
(
p
,
len
,
GFP_KERNEL
);
if
(
unlikely
(
dest
->
data
==
NULL
))
return
ERR_PTR
(
-
ENOMEM
);
dest
->
len
=
len
;
memcpy
(
dest
->
data
,
p
,
len
);
return
q
;
}
...
...
net/sunrpc/auth_gss/gss_krb5_mech.c
View file @
e69062b4
...
...
@@ -70,10 +70,9 @@ simple_get_netobj(const void *p, const void *end, struct xdr_netobj *res)
q
=
(
const
void
*
)((
const
char
*
)
p
+
len
);
if
(
unlikely
(
q
>
end
||
q
<
p
))
return
ERR_PTR
(
-
EFAULT
);
res
->
data
=
km
alloc
(
len
,
GFP_KERNEL
);
res
->
data
=
km
emdup
(
p
,
len
,
GFP_KERNEL
);
if
(
unlikely
(
res
->
data
==
NULL
))
return
ERR_PTR
(
-
ENOMEM
);
memcpy
(
res
->
data
,
p
,
len
);
res
->
len
=
len
;
return
q
;
}
...
...
net/sunrpc/auth_gss/gss_spkm3_mech.c
View file @
e69062b4
...
...
@@ -76,10 +76,9 @@ simple_get_netobj(const void *p, const void *end, struct xdr_netobj *res)
q
=
(
const
void
*
)((
const
char
*
)
p
+
len
);
if
(
unlikely
(
q
>
end
||
q
<
p
))
return
ERR_PTR
(
-
EFAULT
);
res
->
data
=
km
alloc
(
len
,
GFP_KERNEL
);
res
->
data
=
km
emdup
(
p
,
len
,
GFP_KERNEL
);
if
(
unlikely
(
res
->
data
==
NULL
))
return
ERR_PTR
(
-
ENOMEM
);
memcpy
(
res
->
data
,
p
,
len
);
return
q
;
}
...
...
net/sunrpc/auth_gss/svcauth_gss.c
View file @
e69062b4
...
...
@@ -113,9 +113,7 @@ static int rsi_match(struct cache_head *a, struct cache_head *b)
static
int
dup_to_netobj
(
struct
xdr_netobj
*
dst
,
char
*
src
,
int
len
)
{
dst
->
len
=
len
;
dst
->
data
=
(
len
?
kmalloc
(
len
,
GFP_KERNEL
)
:
NULL
);
if
(
dst
->
data
)
memcpy
(
dst
->
data
,
src
,
len
);
dst
->
data
=
(
len
?
kmemdup
(
src
,
len
,
GFP_KERNEL
)
:
NULL
);
if
(
len
&&
!
dst
->
data
)
return
-
ENOMEM
;
return
0
;
...
...
@@ -756,10 +754,9 @@ svcauth_gss_register_pseudoflavor(u32 pseudoflavor, char * name)
if
(
!
new
)
goto
out
;
kref_init
(
&
new
->
h
.
ref
);
new
->
h
.
name
=
k
malloc
(
strlen
(
name
)
+
1
,
GFP_KERNEL
);
new
->
h
.
name
=
k
strdup
(
name
,
GFP_KERNEL
);
if
(
!
new
->
h
.
name
)
goto
out_free_dom
;
strcpy
(
new
->
h
.
name
,
name
);
new
->
h
.
flavour
=
&
svcauthops_gss
;
new
->
pseudoflavor
=
pseudoflavor
;
...
...
net/sunrpc/clnt.c
View file @
e69062b4
...
...
@@ -253,10 +253,9 @@ rpc_clone_client(struct rpc_clnt *clnt)
{
struct
rpc_clnt
*
new
;
new
=
km
alloc
(
sizeof
(
*
new
),
GFP_KERNEL
);
new
=
km
emdup
(
clnt
,
sizeof
(
*
new
),
GFP_KERNEL
);
if
(
!
new
)
goto
out_no_clnt
;
memcpy
(
new
,
clnt
,
sizeof
(
*
new
));
atomic_set
(
&
new
->
cl_count
,
1
);
atomic_set
(
&
new
->
cl_users
,
0
);
new
->
cl_parent
=
clnt
;
...
...
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