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
6e3a9a7f
Commit
6e3a9a7f
authored
Jun 03, 2004
by
Alexander Viro
Committed by
Linus Torvalds
Jun 03, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] sparse: rose annotation
parent
e48caf2c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
11 deletions
+12
-11
include/net/rose.h
include/net/rose.h
+1
-1
net/rose/af_rose.c
net/rose/af_rose.c
+10
-9
net/rose/rose_route.c
net/rose/rose_route.c
+1
-1
No files found.
include/net/rose.h
View file @
6e3a9a7f
...
...
@@ -207,7 +207,7 @@ extern struct net_device *rose_dev_get(rose_address *);
extern
struct
rose_route
*
rose_route_free_lci
(
unsigned
int
,
struct
rose_neigh
*
);
extern
struct
net_device
*
rose_ax25_dev_get
(
char
*
);
extern
struct
rose_neigh
*
rose_get_neigh
(
rose_address
*
,
unsigned
char
*
,
unsigned
char
*
);
extern
int
rose_rt_ioctl
(
unsigned
int
,
void
*
);
extern
int
rose_rt_ioctl
(
unsigned
int
,
void
__user
*
);
extern
void
rose_link_failed
(
ax25_cb
*
,
int
);
extern
int
rose_route_frame
(
struct
sk_buff
*
,
ax25_cb
*
);
extern
void
rose_rt_free
(
void
);
...
...
net/rose/af_rose.c
View file @
6e3a9a7f
...
...
@@ -1249,6 +1249,7 @@ static int rose_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
{
struct
sock
*
sk
=
sock
->
sk
;
rose_cb
*
rose
=
rose_sk
(
sk
);
void
__user
*
argp
=
(
void
__user
*
)
arg
;
switch
(
cmd
)
{
case
TIOCOUTQ
:
{
...
...
@@ -1256,7 +1257,7 @@ static int rose_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
amount
=
sk
->
sk_sndbuf
-
atomic_read
(
&
sk
->
sk_wmem_alloc
);
if
(
amount
<
0
)
amount
=
0
;
return
put_user
(
amount
,
(
unsigned
int
*
)
arg
);
return
put_user
(
amount
,
(
unsigned
int
__user
*
)
argp
);
}
case
TIOCINQ
:
{
...
...
@@ -1265,12 +1266,12 @@ static int rose_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
/* These two are safe on a single CPU system as only user tasks fiddle here */
if
((
skb
=
skb_peek
(
&
sk
->
sk_receive_queue
))
!=
NULL
)
amount
=
skb
->
len
;
return
put_user
(
amount
,
(
unsigned
int
*
)
arg
);
return
put_user
(
amount
,
(
unsigned
int
__user
*
)
argp
);
}
case
SIOCGSTAMP
:
if
(
sk
!=
NULL
)
return
sock_get_timestamp
(
sk
,
(
struct
timeval
__user
*
)
arg
);
return
sock_get_timestamp
(
sk
,
(
struct
timeval
__user
*
)
arg
p
);
return
-
EINVAL
;
case
SIOCGIFADDR
:
...
...
@@ -1290,18 +1291,18 @@ static int rose_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
case
SIOCRSCLRRT
:
if
(
!
capable
(
CAP_NET_ADMIN
))
return
-
EPERM
;
return
rose_rt_ioctl
(
cmd
,
(
void
*
)
arg
);
return
rose_rt_ioctl
(
cmd
,
argp
);
case
SIOCRSGCAUSE
:
{
struct
rose_cause_struct
rose_cause
;
rose_cause
.
cause
=
rose
->
cause
;
rose_cause
.
diagnostic
=
rose
->
diagnostic
;
return
copy_to_user
(
(
void
*
)
arg
,
&
rose_cause
,
sizeof
(
struct
rose_cause_struct
))
?
-
EFAULT
:
0
;
return
copy_to_user
(
argp
,
&
rose_cause
,
sizeof
(
struct
rose_cause_struct
))
?
-
EFAULT
:
0
;
}
case
SIOCRSSCAUSE
:
{
struct
rose_cause_struct
rose_cause
;
if
(
copy_from_user
(
&
rose_cause
,
(
void
*
)
arg
,
sizeof
(
struct
rose_cause_struct
)))
if
(
copy_from_user
(
&
rose_cause
,
argp
,
sizeof
(
struct
rose_cause_struct
)))
return
-
EFAULT
;
rose
->
cause
=
rose_cause
.
cause
;
rose
->
diagnostic
=
rose_cause
.
diagnostic
;
...
...
@@ -1312,14 +1313,14 @@ static int rose_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
if
(
!
capable
(
CAP_NET_ADMIN
))
return
-
EPERM
;
if
(
ax25cmp
(
&
rose_callsign
,
&
null_ax25_address
)
!=
0
)
ax25_listen_release
(
&
rose_callsign
,
NULL
);
if
(
copy_from_user
(
&
rose_callsign
,
(
void
*
)
arg
,
sizeof
(
ax25_address
)))
if
(
copy_from_user
(
&
rose_callsign
,
argp
,
sizeof
(
ax25_address
)))
return
-
EFAULT
;
if
(
ax25cmp
(
&
rose_callsign
,
&
null_ax25_address
)
!=
0
)
ax25_listen_register
(
&
rose_callsign
,
NULL
);
return
0
;
case
SIOCRSGL2CALL
:
return
copy_to_user
(
(
void
*
)
arg
,
&
rose_callsign
,
sizeof
(
ax25_address
))
?
-
EFAULT
:
0
;
return
copy_to_user
(
argp
,
&
rose_callsign
,
sizeof
(
ax25_address
))
?
-
EFAULT
:
0
;
case
SIOCRSACCEPT
:
if
(
rose
->
state
==
ROSE_STATE_5
)
{
...
...
@@ -1335,7 +1336,7 @@ static int rose_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
return
0
;
default:
return
dev_ioctl
(
cmd
,
(
void
__user
*
)
arg
);
return
dev_ioctl
(
cmd
,
argp
);
}
return
0
;
...
...
net/rose/rose_route.c
View file @
6e3a9a7f
...
...
@@ -710,7 +710,7 @@ struct rose_neigh *rose_get_neigh(rose_address *addr, unsigned char *cause,
/*
* Handle the ioctls that control the routing functions.
*/
int
rose_rt_ioctl
(
unsigned
int
cmd
,
void
*
arg
)
int
rose_rt_ioctl
(
unsigned
int
cmd
,
void
__user
*
arg
)
{
struct
rose_route_struct
rose_route
;
struct
net_device
*
dev
;
...
...
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