projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
50b2ff1
)
net/netrom: Fix socket locking
author
Jean Delvare
<
[email protected]
>
Wed, 22 Apr 2009 07:49:51 +0000
(
00:49
-0700)
committer
David S. Miller
<
[email protected]
>
Wed, 22 Apr 2009 07:49:51 +0000
(
00:49
-0700)
Patch "af_rose/x25: Sanity check the maximum user frame size"
(commit
83e0bbcbe2145f160fbaa109b0439dae7f4a38a9
) from Alan Cox got
locking wrong. If we bail out due to user frame size being too large,
we must unlock the socket beforehand.
Signed-off-by: Jean Delvare <
[email protected]
>
Signed-off-by: David S. Miller <
[email protected]
>
net/netrom/af_netrom.c
patch
|
blob
|
history
diff --git
a/net/netrom/af_netrom.c
b/net/netrom/af_netrom.c
index 4e705f87969f332c30939dc8acabd4f8d4d74352..3be0e016ab7df1bd34576816c1ea97232c36c7e8 100644
(file)
--- a/
net/netrom/af_netrom.c
+++ b/
net/netrom/af_netrom.c
@@
-1084,8
+1084,10
@@
static int nr_sendmsg(struct kiocb *iocb, struct socket *sock,
/* Build a packet - the conventional user limit is 236 bytes. We can
do ludicrously large NetROM frames but must not overflow */
- if (len > 65536)
- return -EMSGSIZE;
+ if (len > 65536) {
+ err = -EMSGSIZE;
+ goto out;
+ }
SOCK_DEBUG(sk, "NET/ROM: sendto: building packet.\n");
size = len + NR_NETWORK_LEN + NR_TRANSPORT_LEN;