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
6fd8c252
Commit
6fd8c252
authored
Apr 21, 2003
by
Jon Grimm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[SCTP] Fix sctp_sendmsg error path when associate fails.
parent
6cf4b403
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
19 deletions
+10
-19
net/sctp/socket.c
net/sctp/socket.c
+10
-19
No files found.
net/sctp/socket.c
View file @
6fd8c252
...
@@ -770,7 +770,7 @@ SCTP_STATIC int sctp_sendmsg(struct kiocb *iocb, struct sock *sk,
...
@@ -770,7 +770,7 @@ SCTP_STATIC int sctp_sendmsg(struct kiocb *iocb, struct sock *sk,
struct
sctp_endpoint
*
ep
;
struct
sctp_endpoint
*
ep
;
struct
sctp_association
*
new_asoc
=
NULL
,
*
asoc
=
NULL
;
struct
sctp_association
*
new_asoc
=
NULL
,
*
asoc
=
NULL
;
struct
sctp_transport
*
transport
,
*
chunk_tp
;
struct
sctp_transport
*
transport
,
*
chunk_tp
;
struct
sctp_chunk
*
chunk
=
NULL
;
struct
sctp_chunk
*
chunk
;
union
sctp_addr
to
;
union
sctp_addr
to
;
struct
sockaddr
*
msg_name
=
NULL
;
struct
sockaddr
*
msg_name
=
NULL
;
struct
sctp_sndrcvinfo
default_sinfo
=
{
0
};
struct
sctp_sndrcvinfo
default_sinfo
=
{
0
};
...
@@ -1066,13 +1066,6 @@ SCTP_STATIC int sctp_sendmsg(struct kiocb *iocb, struct sock *sk,
...
@@ -1066,13 +1066,6 @@ SCTP_STATIC int sctp_sendmsg(struct kiocb *iocb, struct sock *sk,
}
else
}
else
chunk_tp
=
NULL
;
chunk_tp
=
NULL
;
/* Break the message into multiple chunks of maximum size. */
datamsg
=
sctp_datamsg_from_user
(
asoc
,
sinfo
,
msg
,
msg_len
);
if
(
!
datamsg
)
{
err
=
-
ENOMEM
;
goto
out_free
;
}
/* Auto-connect, if we aren't connected already. */
/* Auto-connect, if we aren't connected already. */
if
(
SCTP_STATE_CLOSED
==
asoc
->
state
)
{
if
(
SCTP_STATE_CLOSED
==
asoc
->
state
)
{
err
=
sctp_primitive_ASSOCIATE
(
asoc
,
NULL
);
err
=
sctp_primitive_ASSOCIATE
(
asoc
,
NULL
);
...
@@ -1081,6 +1074,13 @@ SCTP_STATIC int sctp_sendmsg(struct kiocb *iocb, struct sock *sk,
...
@@ -1081,6 +1074,13 @@ SCTP_STATIC int sctp_sendmsg(struct kiocb *iocb, struct sock *sk,
SCTP_DEBUG_PRINTK
(
"We associated primitively.
\n
"
);
SCTP_DEBUG_PRINTK
(
"We associated primitively.
\n
"
);
}
}
/* Break the message into multiple chunks of maximum size. */
datamsg
=
sctp_datamsg_from_user
(
asoc
,
sinfo
,
msg
,
msg_len
);
if
(
!
datamsg
)
{
err
=
-
ENOMEM
;
goto
out_free
;
}
/* Now send the (possibly) fragmented message. */
/* Now send the (possibly) fragmented message. */
list_for_each_safe
(
pos
,
temp
,
&
datamsg
->
chunks
)
{
list_for_each_safe
(
pos
,
temp
,
&
datamsg
->
chunks
)
{
chunk
=
list_entry
(
pos
,
struct
sctp_chunk
,
frag_list
);
chunk
=
list_entry
(
pos
,
struct
sctp_chunk
,
frag_list
);
...
@@ -1096,25 +1096,16 @@ SCTP_STATIC int sctp_sendmsg(struct kiocb *iocb, struct sock *sk,
...
@@ -1096,25 +1096,16 @@ SCTP_STATIC int sctp_sendmsg(struct kiocb *iocb, struct sock *sk,
SCTP_DEBUG_PRINTK
(
"We sent primitively.
\n
"
);
SCTP_DEBUG_PRINTK
(
"We sent primitively.
\n
"
);
}
}
sctp_datamsg_free
(
datamsg
);
sctp_datamsg_free
(
datamsg
);
if
(
!
err
)
{
err
=
msg_len
;
err
=
msg_len
;
goto
out_unlock
;
}
/* If we are already past ASSOCIATE, the lower
/* If we are already past ASSOCIATE, the lower
* layers are responsible for association cleanup.
* layers are responsible for association cleanup.
*/
*/
goto
out_
free_chun
k
;
goto
out_
unloc
k
;
out_free:
out_free:
if
(
new_asoc
)
if
(
new_asoc
)
sctp_association_free
(
asoc
);
sctp_association_free
(
asoc
);
out_free_chunk:
/* The datamsg struct will auto-destruct via ref counting. */
if
(
chunk
)
sctp_chunk_free
(
chunk
);
out_unlock:
out_unlock:
sctp_release_sock
(
sk
);
sctp_release_sock
(
sk
);
...
...
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